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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,488,356 | 12/20/2010 09:29:16 | 148,671 | 07/31/2009 19:13:02 | 20 | 7 | what is .net framework | i have been asked in an interview that what is .NET framework.How can i define it to a layman | .net | null | null | null | null | 12/20/2010 09:43:25 | not a real question | what is .net framework
===
i have been asked in an interview that what is .NET framework.How can i define it to a layman | 1 |
3,195,674 | 07/07/2010 14:25:03 | 362,332 | 06/09/2010 11:12:32 | 33 | 3 | Spring 3.x - Will it play in App Engine ? | Spring 3.x is conspicuously absent from the official [Will it play in app engine?][1]
Has anybody got it up and running?
Any issues with the following?
1. Fully annotated controllers?
2. Annotated JSR 303 validation?
[1]: http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine | google-app-engine | spring | null | null | null | null | open | Spring 3.x - Will it play in App Engine ?
===
Spring 3.x is conspicuously absent from the official [Will it play in app engine?][1]
Has anybody got it up and running?
Any issues with the following?
1. Fully annotated controllers?
2. Annotated JSR 303 validation?
[1]: http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine | 0 |
8,780,504 | 01/08/2012 19:27:32 | 1,137,178 | 01/08/2012 14:55:31 | 5 | 0 | Force Close on Button | Why is my app force closing when I hit the button to start the Activity of First
This is the startup Activity:
public class ForeverAlone extends Activity implements OnClickListener{
/** Called when the activity is first created. */
Button start;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
start = (Button) findViewById(R.id.bStart);
start.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent myIntent = new Intent(ForeverAlone.this, First.class);
ForeverAlone.this.startActivity(myIntent);
}
}
This is the Activity that is MEANT to come up after I hit the button:
public class First extends Activity implements OnClickListener {
Button firstNext;
EditText firstFacebook, firstReallife;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.first);
firstNext = (Button) findViewById(R.id.bFirstNext);
firstFacebook = (EditText) findViewById(R.id.etFirst1);
firstReallife = (EditText) findViewById(R.id.etFirst2);
firstNext.setOnClickListener(this);
String firstFB = firstFacebook.getText().toString();
String firstRL = firstReallife.getText().toString();
DataHelper.insert(firstFB, firstRL);
}
@Override
public void onClick(View v) {
Intent myIntent = new Intent(First.this, Second.class);
First.this.startActivity(myIntent);
}
}
Any help at all will be appreciated! | button | activity | forceclose | null | null | null | open | Force Close on Button
===
Why is my app force closing when I hit the button to start the Activity of First
This is the startup Activity:
public class ForeverAlone extends Activity implements OnClickListener{
/** Called when the activity is first created. */
Button start;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
start = (Button) findViewById(R.id.bStart);
start.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Intent myIntent = new Intent(ForeverAlone.this, First.class);
ForeverAlone.this.startActivity(myIntent);
}
}
This is the Activity that is MEANT to come up after I hit the button:
public class First extends Activity implements OnClickListener {
Button firstNext;
EditText firstFacebook, firstReallife;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.first);
firstNext = (Button) findViewById(R.id.bFirstNext);
firstFacebook = (EditText) findViewById(R.id.etFirst1);
firstReallife = (EditText) findViewById(R.id.etFirst2);
firstNext.setOnClickListener(this);
String firstFB = firstFacebook.getText().toString();
String firstRL = firstReallife.getText().toString();
DataHelper.insert(firstFB, firstRL);
}
@Override
public void onClick(View v) {
Intent myIntent = new Intent(First.this, Second.class);
First.this.startActivity(myIntent);
}
}
Any help at all will be appreciated! | 0 |
6,280,962 | 06/08/2011 15:03:44 | 118,342 | 06/05/2009 22:43:26 | 35 | 1 | Excel Split Single Array into Multiple Cells | An application I use exports strings of data in an array in once cell, like so:
"data1"= value1; "data2"= value2; "data3"= value3; "data4"= value4; "data5"= value5;
I'd like an equation or macro or something that could split it like this:
------------------------------------------------------
| | data1 | data2 | data3 | data4 | data5 |
------------------------------------------------------
| 1 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
| 2 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
| 3 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
Is this possible?
Excel 2003 on Windows XP | arrays | excel | microsoft | split | rows | null | open | Excel Split Single Array into Multiple Cells
===
An application I use exports strings of data in an array in once cell, like so:
"data1"= value1; "data2"= value2; "data3"= value3; "data4"= value4; "data5"= value5;
I'd like an equation or macro or something that could split it like this:
------------------------------------------------------
| | data1 | data2 | data3 | data4 | data5 |
------------------------------------------------------
| 1 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
| 2 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
| 3 | value1 | value2 | value3 | value4 | value5 |
------------------------------------------------------
Is this possible?
Excel 2003 on Windows XP | 0 |
3,311,691 | 07/22/2010 17:39:25 | 399,405 | 07/22/2010 17:31:42 | 1 | 0 | Paging in Gridview, can't access another page | I have a web app where everytime I upload an Excel file, its contents appears in Gridview, which is binded with a DataTable.
Using the properties, I have set paging and sorting to true.
When I input a file using fileupload and a submit button, the web app has page numbers at the bottom appear.
It also correctly sorts it, (my page size is set to 10), however, when i click on the next page (pg 2, for instance), nothing shows up until i upload the another file and hit submit again.
This is the code in which I build the table:
protected void AddResultToGrid(String url, String result)
{
data = (DataTable)Session["URLSessionData"];
DataRow dr = data.NewRow();
dr[0] = url;
dr[1] = result;
data.Rows.Add(dr);
gdvResults.DataSource = data;
gdvResults.DataBind();
Session["URLSessionData"] = data;
}
This is the page load:
protected void Page_Load(object sender, EventArgs e)
{
lblFiup.Text = "";
data.Columns.Add("URL", typeof(String));
data.Columns.Add("Status", typeof(String));
gdvResults.DataSource = data;
gdvResults.DataBind();
gdvResults.AllowPaging = true;
gdvResults.AllowSorting = true;
if (!Page.IsPostBack)
{
Session["URLSessionData"] = data;
}
}
I think it may have something to do with the page index... but i'm not sure.
Here's my page index change method:
protected void gdvResults_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
e.NewPageIndex = e.NewPageIndex + 1;
DataBind();
}
Thanks in advance for your help (:
| c# | gridview | paging | null | null | 12/29/2011 23:14:53 | too localized | Paging in Gridview, can't access another page
===
I have a web app where everytime I upload an Excel file, its contents appears in Gridview, which is binded with a DataTable.
Using the properties, I have set paging and sorting to true.
When I input a file using fileupload and a submit button, the web app has page numbers at the bottom appear.
It also correctly sorts it, (my page size is set to 10), however, when i click on the next page (pg 2, for instance), nothing shows up until i upload the another file and hit submit again.
This is the code in which I build the table:
protected void AddResultToGrid(String url, String result)
{
data = (DataTable)Session["URLSessionData"];
DataRow dr = data.NewRow();
dr[0] = url;
dr[1] = result;
data.Rows.Add(dr);
gdvResults.DataSource = data;
gdvResults.DataBind();
Session["URLSessionData"] = data;
}
This is the page load:
protected void Page_Load(object sender, EventArgs e)
{
lblFiup.Text = "";
data.Columns.Add("URL", typeof(String));
data.Columns.Add("Status", typeof(String));
gdvResults.DataSource = data;
gdvResults.DataBind();
gdvResults.AllowPaging = true;
gdvResults.AllowSorting = true;
if (!Page.IsPostBack)
{
Session["URLSessionData"] = data;
}
}
I think it may have something to do with the page index... but i'm not sure.
Here's my page index change method:
protected void gdvResults_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
e.NewPageIndex = e.NewPageIndex + 1;
DataBind();
}
Thanks in advance for your help (:
| 3 |
6,733,557 | 07/18/2011 13:23:01 | 659,639 | 03/14/2011 22:06:25 | 169 | 0 | Standard Projects in C# for evaluating the design pattern detection | I have implemented few techniques to detect design pattern in C# code. I wanted few projects to test the correctness of my implementation. I am searching for free open souce project which has the staticstics of the number of design patterns in it.
I am searching for projects with GoF patterns like adapter pattern etc.
It would be helpful if I get few links to such projects with the number of design patetrn in it.
Thanks in Advance. | c# | design-patterns | open-source | projects-and-solutions | null | 07/18/2011 20:15:49 | not a real question | Standard Projects in C# for evaluating the design pattern detection
===
I have implemented few techniques to detect design pattern in C# code. I wanted few projects to test the correctness of my implementation. I am searching for free open souce project which has the staticstics of the number of design patterns in it.
I am searching for projects with GoF patterns like adapter pattern etc.
It would be helpful if I get few links to such projects with the number of design patetrn in it.
Thanks in Advance. | 1 |
26,879 | 08/25/2008 21:01:14 | 1,144 | 08/12/2008 19:00:54 | 132 | 9 | Browser scrollbar | I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother.
However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the content not on the screen. This makes my site jump a few pixels to the left. Thus the headers are not perfectely aligned anymore.
IE always has a scrollbar, so the site never jumps around in IE.
Does anyone know a JavaScript/CSS/HTML solution for this problem? | browsers | webdesign | null | null | null | null | open | Browser scrollbar
===
I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother.
However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the content not on the screen. This makes my site jump a few pixels to the left. Thus the headers are not perfectely aligned anymore.
IE always has a scrollbar, so the site never jumps around in IE.
Does anyone know a JavaScript/CSS/HTML solution for this problem? | 0 |
8,893,919 | 01/17/2012 11:34:43 | 692,456 | 04/05/2011 08:07:52 | 1,303 | 47 | Why does jQuery library source code always have spaces around function arguments? | The source code to jQuery and UI libraries always use spaces around function arguments. For example:
$( event.target ).attr( "tabIndex", -1 );
What is the purpose of this? Why not:
$(event.target).attr("tabIndex", -1);
I find the latter much easier to look at. Is there any reason why the developers have made this choice? | javascript | jquery | jquery-ui | coding-style | null | 01/17/2012 12:12:52 | not constructive | Why does jQuery library source code always have spaces around function arguments?
===
The source code to jQuery and UI libraries always use spaces around function arguments. For example:
$( event.target ).attr( "tabIndex", -1 );
What is the purpose of this? Why not:
$(event.target).attr("tabIndex", -1);
I find the latter much easier to look at. Is there any reason why the developers have made this choice? | 4 |
11,443,668 | 07/12/2012 00:52:59 | 605,957 | 02/07/2011 05:16:25 | 173 | 0 | what are some good menu driven UI sample applications for the iPhone | What are some of the good, Facebook like or twitter or 4square like sample applications for the iPhone from the developer portal? Thy do not include screen shots and most of the sample applications have a bad user experience. | iphone | iphone-sdk-4.0 | user-interface | null | null | 07/13/2012 15:36:00 | not constructive | what are some good menu driven UI sample applications for the iPhone
===
What are some of the good, Facebook like or twitter or 4square like sample applications for the iPhone from the developer portal? Thy do not include screen shots and most of the sample applications have a bad user experience. | 4 |
3,016,164 | 06/10/2010 16:04:58 | 150,363 | 08/04/2009 13:39:22 | 624 | 93 | check image copyright | Currently I am manually checking all client website(s) to make sure there are no copyright images (Getty).
Are there any tools/software that could be used to determine automatically if a website has any images that belong to Getty (or other similar companies?) | image | website | copyright | null | null | 03/23/2011 15:21:58 | off topic | check image copyright
===
Currently I am manually checking all client website(s) to make sure there are no copyright images (Getty).
Are there any tools/software that could be used to determine automatically if a website has any images that belong to Getty (or other similar companies?) | 2 |
4,458,157 | 12/16/2010 06:46:47 | 443,075 | 09/09/2010 05:02:44 | 286 | 30 | How to close all threads on Browser close event? | I have website which runs multiple threads. When user close the browser but threads are still running. How to kill/stop all thread in asp.net on browser close. | asp.net | null | null | null | null | null | open | How to close all threads on Browser close event?
===
I have website which runs multiple threads. When user close the browser but threads are still running. How to kill/stop all thread in asp.net on browser close. | 0 |
8,119,393 | 11/14/2011 09:17:01 | 1,018,322 | 10/28/2011 12:37:21 | 8 | 0 | Java API - OMR (Optimal Mark Recognition) | I'm looking for a Java OMR API to the recognition of forms (and maybe barcode). I searched on google but I did not find an free and good API...
Does someone know a good?
Sorry for my english... And thanks you in advance.
Akiat
| java | api | null | null | null | 11/14/2011 10:15:51 | not a real question | Java API - OMR (Optimal Mark Recognition)
===
I'm looking for a Java OMR API to the recognition of forms (and maybe barcode). I searched on google but I did not find an free and good API...
Does someone know a good?
Sorry for my english... And thanks you in advance.
Akiat
| 1 |
7,065,835 | 08/15/2011 14:01:37 | 893,532 | 08/14/2011 01:26:42 | 24 | 1 | What is this? (auto drop-down) | I store a list of names in a text file. When I enter any single character on a text boc position on the main form, I need a small window to display and list the term I may choose to fill in. I don't what this is called to search the iNternet if there exists a similar source code for me to use.
Thank you. | c# | null | null | null | null | 08/15/2011 14:07:16 | not a real question | What is this? (auto drop-down)
===
I store a list of names in a text file. When I enter any single character on a text boc position on the main form, I need a small window to display and list the term I may choose to fill in. I don't what this is called to search the iNternet if there exists a similar source code for me to use.
Thank you. | 1 |
10,615,089 | 05/16/2012 08:53:44 | 372,452 | 06/21/2010 18:24:21 | 44 | 0 | Serialize list with base type into derived type json | I have a Web API controller action which has a parameter of type CommandMessage. That type has a list with base types, CommandBase. My problem is that I can't make them to be of derived types, MyCommand in this example.
I'm using [JsonNetFormatter](https://github.com/WebApiContrib/WebAPIContrib/blob/master/src/WebApiContrib.Formatting.JsonNet/JsonNetFormatter.cs) from the Web API contrib project. It's using Json.Net as serializer.
Web API controller:
public class CommandController : ApiController
{
public HttpResponseMessage Post(CommandMessage command)
{
//command.Commands[0].GetType().Name is always "CommandBase" instead of "MyCommand"
var message = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(string.Format("Type of command 1 is '{0}'", command.Commands[0].GetType().FullName))
};
return message;
}
}
This i my request:
private void When()
{
using (client)
{
command = new MyCommand
{
CommandId = Guid.NewGuid(),
Id = Guid.NewGuid(),
Name = "Martin"
};
var message = new CommandMessage(Guid.NewGuid(),new List<CommandBase> {command});
var requestMessage = GetHttpRequestMessage(message);
var task = client.PostAsync("http://localhost.:16218/api/command", requestMessage.Content);
task.Wait();
responseMessage = task.Result;
}
}
private static HttpRequestMessage GetHttpRequestMessage<T>(T data)
{
var mediaType = new MediaTypeHeaderValue("application/json");
var jsonFormatter = new JsonNetFormatter(DefaultJsonSettings.Settings());
var requestMessage = new HttpRequestMessage<T>(data, mediaType, new[] {jsonFormatter});
return requestMessage;
}
And as JSON:
{
"$type": "PostToBaseClassList.Models.CommandMessage, PostToBaseClassList",
"Commands": [
{
"$type": "PostToBaseClassList.Models.MyCommand, PostToBaseClassList",
"Id": "45923a41-0c15-46e3-907d-64dd06840539",
"Name": "Martin"
}
],
"MessageId": "c873970a-8621-4223-806e-b809039438ab"
}
The return message from the API controller action is:
> Type of command 1 is 'PostToBaseClassList.Models.CommandBase'
Command classes:
[DataContract]
[XmlRoot]
public class MyCommand : CommandBase
{
private readonly string name;
public MyCommand()
{
}
public MyCommand(Guid id, string name)
{
this.name = name;
Id = id;
}
[DataMember(Order = 1)]
[XmlElement]
public Guid Id { get; set; }
[DataMember(Order = 2)]
[XmlElement]
public string Name { get; set; }
}
[DataContract]
[KnownType("GetKnownTypes")]
public class CommandBase
{
public Guid CommandId { get; set; }
public static Type[] GetKnownTypes()
{
var query =
from type in typeof (CommandBase).Assembly.GetTypes()
where typeof (CommandBase).IsAssignableFrom(type)
select type;
var types = query.ToArray();
return types;
}
}
[DataContract]
[Serializable]
[XmlRoot]
public class CommandMessage
{
public CommandMessage()
{
}
public CommandMessage(Guid messageId, IEnumerable<CommandBase> commands)
{
MessageId = messageId;
Commands = new List<CommandBase>(commands);
}
[DataMember]
[XmlElement]
public List<CommandBase> Commands { get; set; }
[DataMember]
[XmlElement]
public Guid MessageId { get; set; }
}
Json.Net settings:
//DefaultJsonSettings.Settings()
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
TypeNameHandling = TypeNameHandling.Objects,
Converters = new List<JsonConverter>
{
new IsoDateTimeConverter
()
}
};
private static void RegisterFormatters(HttpConfiguration config)
{
var jsonNetFormatter = new JsonNetFormatter(DefaultJsonSettings.Settings());
config.Formatters.Insert(0, jsonNetFormatter);
}
Any ideas? | c# | .net | json | json.net | asp.net-web-api | null | open | Serialize list with base type into derived type json
===
I have a Web API controller action which has a parameter of type CommandMessage. That type has a list with base types, CommandBase. My problem is that I can't make them to be of derived types, MyCommand in this example.
I'm using [JsonNetFormatter](https://github.com/WebApiContrib/WebAPIContrib/blob/master/src/WebApiContrib.Formatting.JsonNet/JsonNetFormatter.cs) from the Web API contrib project. It's using Json.Net as serializer.
Web API controller:
public class CommandController : ApiController
{
public HttpResponseMessage Post(CommandMessage command)
{
//command.Commands[0].GetType().Name is always "CommandBase" instead of "MyCommand"
var message = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(string.Format("Type of command 1 is '{0}'", command.Commands[0].GetType().FullName))
};
return message;
}
}
This i my request:
private void When()
{
using (client)
{
command = new MyCommand
{
CommandId = Guid.NewGuid(),
Id = Guid.NewGuid(),
Name = "Martin"
};
var message = new CommandMessage(Guid.NewGuid(),new List<CommandBase> {command});
var requestMessage = GetHttpRequestMessage(message);
var task = client.PostAsync("http://localhost.:16218/api/command", requestMessage.Content);
task.Wait();
responseMessage = task.Result;
}
}
private static HttpRequestMessage GetHttpRequestMessage<T>(T data)
{
var mediaType = new MediaTypeHeaderValue("application/json");
var jsonFormatter = new JsonNetFormatter(DefaultJsonSettings.Settings());
var requestMessage = new HttpRequestMessage<T>(data, mediaType, new[] {jsonFormatter});
return requestMessage;
}
And as JSON:
{
"$type": "PostToBaseClassList.Models.CommandMessage, PostToBaseClassList",
"Commands": [
{
"$type": "PostToBaseClassList.Models.MyCommand, PostToBaseClassList",
"Id": "45923a41-0c15-46e3-907d-64dd06840539",
"Name": "Martin"
}
],
"MessageId": "c873970a-8621-4223-806e-b809039438ab"
}
The return message from the API controller action is:
> Type of command 1 is 'PostToBaseClassList.Models.CommandBase'
Command classes:
[DataContract]
[XmlRoot]
public class MyCommand : CommandBase
{
private readonly string name;
public MyCommand()
{
}
public MyCommand(Guid id, string name)
{
this.name = name;
Id = id;
}
[DataMember(Order = 1)]
[XmlElement]
public Guid Id { get; set; }
[DataMember(Order = 2)]
[XmlElement]
public string Name { get; set; }
}
[DataContract]
[KnownType("GetKnownTypes")]
public class CommandBase
{
public Guid CommandId { get; set; }
public static Type[] GetKnownTypes()
{
var query =
from type in typeof (CommandBase).Assembly.GetTypes()
where typeof (CommandBase).IsAssignableFrom(type)
select type;
var types = query.ToArray();
return types;
}
}
[DataContract]
[Serializable]
[XmlRoot]
public class CommandMessage
{
public CommandMessage()
{
}
public CommandMessage(Guid messageId, IEnumerable<CommandBase> commands)
{
MessageId = messageId;
Commands = new List<CommandBase>(commands);
}
[DataMember]
[XmlElement]
public List<CommandBase> Commands { get; set; }
[DataMember]
[XmlElement]
public Guid MessageId { get; set; }
}
Json.Net settings:
//DefaultJsonSettings.Settings()
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
TypeNameHandling = TypeNameHandling.Objects,
Converters = new List<JsonConverter>
{
new IsoDateTimeConverter
()
}
};
private static void RegisterFormatters(HttpConfiguration config)
{
var jsonNetFormatter = new JsonNetFormatter(DefaultJsonSettings.Settings());
config.Formatters.Insert(0, jsonNetFormatter);
}
Any ideas? | 0 |
8,606,448 | 12/22/2011 16:00:07 | 574,633 | 01/13/2011 17:27:26 | 104 | 1 | Functional reactive programming (FRP) in games. Some doubts and thoughts | This days I'm doing some research on Component based entity systems. I had a first aproximation using a blackboard pattern at Entity level and components sharing this blackboard to do communication.
Doing this research I found an entity framework called Artemis, that follows a FRP structure for the entity managment. The idea seems pretty good and would like to integrate in my engine. But have some questions that need to solve to understand this way of doing things:
1) In my first aproximation the way components share data is pretty straight forward following the blackboard pattern. How should this be done following FRP? It seems, each system would be the ones holding all depencencies to components (Making components totally decoupled). I mean if the collision system needs to know about physic component, movable system, etc... The collision system would import all this components and do all needed work with them. Is this right?
2) Would each system be a homogeneus or heterogeneus component container?
3) How does an event system fit in this structure? I ussually have slot/signals in game objects for this but it seems with artemis structure there's no "Entity" concept.
Sorry for the long question and thanks in advance. | c++ | game-engine | frp | null | null | 12/23/2011 07:25:38 | off topic | Functional reactive programming (FRP) in games. Some doubts and thoughts
===
This days I'm doing some research on Component based entity systems. I had a first aproximation using a blackboard pattern at Entity level and components sharing this blackboard to do communication.
Doing this research I found an entity framework called Artemis, that follows a FRP structure for the entity managment. The idea seems pretty good and would like to integrate in my engine. But have some questions that need to solve to understand this way of doing things:
1) In my first aproximation the way components share data is pretty straight forward following the blackboard pattern. How should this be done following FRP? It seems, each system would be the ones holding all depencencies to components (Making components totally decoupled). I mean if the collision system needs to know about physic component, movable system, etc... The collision system would import all this components and do all needed work with them. Is this right?
2) Would each system be a homogeneus or heterogeneus component container?
3) How does an event system fit in this structure? I ussually have slot/signals in game objects for this but it seems with artemis structure there's no "Entity" concept.
Sorry for the long question and thanks in advance. | 2 |
10,666,568 | 05/19/2012 15:32:40 | 1,015,595 | 10/26/2011 23:39:11 | 34 | 1 | Using .htaccess file to redirect to a subdomain | Hopefully someone will be able to tell me how to do this. In my root folder, I have a home directory and a test directory. Basically, I want all requests for mydomain.com or www.mydomain.com or home.mydomain.com to be routed to mydomain.com/home, but I want the user's address bar to read home.mydomain.com.
At the same time, I'd like to be able to go to test.mydomain.com to access our test site, which is mydomain.com/test. | apache | .htaccess | mod-rewrite | null | null | null | open | Using .htaccess file to redirect to a subdomain
===
Hopefully someone will be able to tell me how to do this. In my root folder, I have a home directory and a test directory. Basically, I want all requests for mydomain.com or www.mydomain.com or home.mydomain.com to be routed to mydomain.com/home, but I want the user's address bar to read home.mydomain.com.
At the same time, I'd like to be able to go to test.mydomain.com to access our test site, which is mydomain.com/test. | 0 |
10,076,220 | 04/09/2012 16:20:45 | 140,750 | 07/18/2009 19:02:44 | 14,768 | 713 | Order of arithmetic expansion | Consider the following:
for i in 1 2 3; do echo $(( j += 1 ))& done
According to (my reading of) the <a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03">sh language spec</a>, section 2.3 paragraph 5, the arithmetic expansion of `j += 1` should take place during token recognition, and should thus be processed before the shell ever reads the `&`. So it seems that executing the above line should increment `j` by 3 and each invocation of echo should get a different argument. (Which is the behavior if '&' is replaced by ';'). In bash 3.2.25, `j` is not modified. Is this a bug in bash, or am I misunderstanding something? | sh | null | null | null | null | null | open | Order of arithmetic expansion
===
Consider the following:
for i in 1 2 3; do echo $(( j += 1 ))& done
According to (my reading of) the <a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03">sh language spec</a>, section 2.3 paragraph 5, the arithmetic expansion of `j += 1` should take place during token recognition, and should thus be processed before the shell ever reads the `&`. So it seems that executing the above line should increment `j` by 3 and each invocation of echo should get a different argument. (Which is the behavior if '&' is replaced by ';'). In bash 3.2.25, `j` is not modified. Is this a bug in bash, or am I misunderstanding something? | 0 |
4,809,705 | 01/26/2011 20:30:41 | 591,294 | 01/26/2011 20:30:41 | 1 | 0 | PDF reading/manipulation API for Java? | I'm about to start a project requiring PDF reading, creation and maybe a bit of editing/additions, in Java. I've already looked over iText and PDF Box, and I was just wondering before I started if you guys knew of any other, better APIs. Would prefer not open source, but it doesnt really matter. | java | pdf | null | null | null | 01/26/2011 22:04:39 | not constructive | PDF reading/manipulation API for Java?
===
I'm about to start a project requiring PDF reading, creation and maybe a bit of editing/additions, in Java. I've already looked over iText and PDF Box, and I was just wondering before I started if you guys knew of any other, better APIs. Would prefer not open source, but it doesnt really matter. | 4 |
11,262,612 | 06/29/2012 13:22:10 | 1,306,589 | 04/01/2012 17:08:40 | 14 | 0 | How can i create and display a self designed window on current webpage instead of popup? | I want to create and display a self designed window on current webpage instead of popup as you can see on this page
[Open the link and click first "Demo" button on that page.][1]
[1]: http://www.ericmmartin.com/projects/simplemodal-demos/#
and the same type window appeared when I tried to put a link on this question on stackoverflow which accepted my link.
for example facebook also uses this type of window to display tagged images.
please help me. | javascript | asp.net | html | css | null | null | open | How can i create and display a self designed window on current webpage instead of popup?
===
I want to create and display a self designed window on current webpage instead of popup as you can see on this page
[Open the link and click first "Demo" button on that page.][1]
[1]: http://www.ericmmartin.com/projects/simplemodal-demos/#
and the same type window appeared when I tried to put a link on this question on stackoverflow which accepted my link.
for example facebook also uses this type of window to display tagged images.
please help me. | 0 |
485,569 | 01/27/2009 22:16:57 | 50,468 | 12/31/2008 11:26:41 | 86 | 5 | Source control with Visual Studio integration for a small project | I'm begining the development of a personal Web Application project. I'd like to have a source control system for that project.
At work, we user Team Foundation Server and I'm quite happy with that, mostly for the Visual Studio integration.
I'd like to know if there was **free** source control solutions that had the same kind of integration with VS2008. | version-control | tfs | visual-studio-2008 | small-projects | null | null | open | Source control with Visual Studio integration for a small project
===
I'm begining the development of a personal Web Application project. I'd like to have a source control system for that project.
At work, we user Team Foundation Server and I'm quite happy with that, mostly for the Visual Studio integration.
I'd like to know if there was **free** source control solutions that had the same kind of integration with VS2008. | 0 |
4,514,806 | 12/22/2010 23:55:42 | 499,989 | 11/07/2010 17:43:54 | 3 | 0 | 100% height div inside 100% td | Ok,
so here is my problem.. and its buggin me for a while...
i need to set the following DIV 100% height inside this TD without any side-effects (by that i mean scrolling), because for some unknown reason, when i set it to 100% height, looks like IE 8 does some wrong calculations..
I tried a lot of combinations but no success..
transitional doctype is required...
thanks in advance for any help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
html, body
{
height:100%;
margin:0px;
padding:0px;
}
</style>
<head>
<body>
<table style="height:100%" border="1">
<tr>
<td>TOP</td>
</tr>
<tr style="height:100%">
<td style="height:100%">
<div style="border:1px dotted blue; height:100%">CONTENT</div>
</td>
</tr>
</table>
</body>
</html> | html | null | null | null | null | null | open | 100% height div inside 100% td
===
Ok,
so here is my problem.. and its buggin me for a while...
i need to set the following DIV 100% height inside this TD without any side-effects (by that i mean scrolling), because for some unknown reason, when i set it to 100% height, looks like IE 8 does some wrong calculations..
I tried a lot of combinations but no success..
transitional doctype is required...
thanks in advance for any help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
html, body
{
height:100%;
margin:0px;
padding:0px;
}
</style>
<head>
<body>
<table style="height:100%" border="1">
<tr>
<td>TOP</td>
</tr>
<tr style="height:100%">
<td style="height:100%">
<div style="border:1px dotted blue; height:100%">CONTENT</div>
</td>
</tr>
</table>
</body>
</html> | 0 |
7,123,881 | 08/19/2011 15:27:18 | 301,639 | 03/25/2010 11:37:07 | 29 | 2 | cant insert date to mysql DB from c sharp | I'm using c sharp and mysql.
when i'm trying to insert a date from DateTime type to date column in DB all i get is `0000-00-00`
i'm parsing my DateTime like this : `sessionDate.ToShortDateString()`
but getting empty date ...
any help please | c# | mysql | datetime | format | null | null | open | cant insert date to mysql DB from c sharp
===
I'm using c sharp and mysql.
when i'm trying to insert a date from DateTime type to date column in DB all i get is `0000-00-00`
i'm parsing my DateTime like this : `sessionDate.ToShortDateString()`
but getting empty date ...
any help please | 0 |
8,297,928 | 11/28/2011 15:13:17 | 1,041,953 | 11/11/2011 15:22:01 | 1 | 0 | Com0Com redirect Serial Port (Serial Mouse) | Here is Complete scenario.
I want to Redirect my Serial Port (COM1) to the Remote PC. I just want that Physical Serial Port must be redirected to the Remote PC. I have Serial Mouse attached with COM1 and when i redirect my Serial Port i am unable to get this mouse installed on Remote PC.
com2tcp-rfc2217 COM1 7000
what i do on remote PC is
com2tcp-rfc2217 \\.\CNCB0 host-hostname 7000
How can it be done using Com0Com and Hub4com? Any help is highly appreciated. I used com2tcp, Com2tcp-esc, com2tcp-rfc2217, but nothing works the way it should.
What can be the issue? How can it be done? | com | serial-port | null | null | null | 11/29/2011 09:29:08 | off topic | Com0Com redirect Serial Port (Serial Mouse)
===
Here is Complete scenario.
I want to Redirect my Serial Port (COM1) to the Remote PC. I just want that Physical Serial Port must be redirected to the Remote PC. I have Serial Mouse attached with COM1 and when i redirect my Serial Port i am unable to get this mouse installed on Remote PC.
com2tcp-rfc2217 COM1 7000
what i do on remote PC is
com2tcp-rfc2217 \\.\CNCB0 host-hostname 7000
How can it be done using Com0Com and Hub4com? Any help is highly appreciated. I used com2tcp, Com2tcp-esc, com2tcp-rfc2217, but nothing works the way it should.
What can be the issue? How can it be done? | 2 |
4,528,192 | 12/24/2010 20:23:46 | 551,832 | 12/22/2010 23:39:02 | 1 | 0 | Database Compression in Python | I have hourly logs like
user1:joined
user2:log out
user1:added pic
user1:added comment
user3:joined
I want to compress all the flat files down to one file. There are around 30 million users in the logs and I just want the latest user log for all the logs.
My end result is I want to have a log look like
user1:added comment
user2:log out
user3:joined
Now my first attempt on a small scale was to just do a dict like
log['user1'] = "added comment"
Will doing a dict of 30 million key/val pairs have a giant memory footprint.. Or should I use something like sqllite to store them.. then just put the contents of the sqllite table back into a file?
| python | null | null | null | null | null | open | Database Compression in Python
===
I have hourly logs like
user1:joined
user2:log out
user1:added pic
user1:added comment
user3:joined
I want to compress all the flat files down to one file. There are around 30 million users in the logs and I just want the latest user log for all the logs.
My end result is I want to have a log look like
user1:added comment
user2:log out
user3:joined
Now my first attempt on a small scale was to just do a dict like
log['user1'] = "added comment"
Will doing a dict of 30 million key/val pairs have a giant memory footprint.. Or should I use something like sqllite to store them.. then just put the contents of the sqllite table back into a file?
| 0 |
6,934,041 | 08/03/2011 22:26:12 | 300,129 | 03/23/2010 16:51:01 | 448 | 17 | Installing Linux (Mint) on Wiped Windows Computer | I have a laptop that has been 'wiped'. If I boot it up, it says "Non-System Disk Error..."
I have downloaded Linux Mint and burnt it to a CD (The files & folders, not the ISO) on a Mac. I then went into BIOS on the wiped computer and set it to boot from CD, but it still says "Non-System Disk Error" and I can't get it to do anything else.
Any ideas about how to make something happen, would be appreciated. | linux | install | bios | mint | null | 08/03/2011 23:30:43 | off topic | Installing Linux (Mint) on Wiped Windows Computer
===
I have a laptop that has been 'wiped'. If I boot it up, it says "Non-System Disk Error..."
I have downloaded Linux Mint and burnt it to a CD (The files & folders, not the ISO) on a Mac. I then went into BIOS on the wiped computer and set it to boot from CD, but it still says "Non-System Disk Error" and I can't get it to do anything else.
Any ideas about how to make something happen, would be appreciated. | 2 |
10,337,253 | 04/26/2012 16:10:13 | 1,348,101 | 04/21/2012 09:30:23 | 1 | 0 | How to merge one animation with another? | I recently posted a question regarding moving multiple images and got some advice from Beetroot (Thanks Beetroot!!)
I am trying to animate pictures accross a gameboard.
I have managed to do this using .animate() feature which has a callback function to run the anamation again.
The problem I have is that as each animation runs the image "accelerates" up to "cruising" speed, continues a distance before "decelerating" to a stop, it then starts this process again.
the effect this has is that thwe image moves in sort of surges.
Is it possible to make the animations blur so that the image doesn't "decelerate" between animations?
I have included the code for the animate function below.
I have tried to comment it as best I can and the example of the page can be seen [here][1]. To get it to work click on an "ind" spot and select the "sawmill" upgrade from pop-up.
function WalkTo(ImgID,Crnt_Coord)
{
//ImgID is a cobination of the coordinate the picture started on plus the word "worker".
//Crnt_Coord is the current coordinate the image is on
var index = parseInt(ImgID.replace("worker", ""));
var Image = Animate_Image[index];// this array holds the Ids for the images for the $(Image) jquery code later.
var Current_Coord = Crnt_Coord;
if(Crnt_Coord==Animate_End_Coord[index])
{Animate_Delivered[index]=1;} //checks to see if image has arrived at destination and sets the delivered to 1
if(Crnt_Coord==index)
{Animate_Delivered[index]=0;}// checks to see if image is back at starting location, sets delivered back to 0 so object can start journey again.
var End_Coord;//destination
if(Animate_Delivered[index]==0){End_Coord = Animate_End_Coord[index];}//if image has not arrived it gets the destination from an array
else{End_Coord = index;}//delivered now set to 1 and destination is set as startposition.
//I now run a simple path finding function to determine next move, it returns as a string the next coodinate and the bearing (north,east,south,west)
var bearing_next_coord = Direction(Current_Coord,End_Coord);
var bearing = bearing_next_coord[0];
var Next_Coord = parseInt(bearing_next_coord.substring(1));
var pos = $(Image).position();//Gets the current pixel position of the image
var left = pos.left;
var top = pos.top;
var imgSrc = "images/animations/"+Animate_Job[index]+"_dude_"+bearing+".gif";//changes the image so worker appears to turn
//The switch below then sets the distance and direction for the image to travel in the .animate
switch(bearing)
{
case "n":
top-=60;
break;
case "e":
left+=60;
break;
case "s":
top+=60;
break;
case "w":
left-=60;
break;
}
if(zone_array[Next_Coord]==""){$(Image).attr("src", "images/icons/boat.gif");}//changes image to boat if the image needs to cross water
else{$(Image).attr("src", imgSrc);}//for land use the imgSrc
//finally the animate using the varibles set above, then set the function to run again with new "currentCoordinate"
$(Image).animate({left: left,top: top}, 1500, function(){WalkTo(ImgID,Next_Coord)});
}
Thanks in advance for any help!!
John
[1]: http://tranquilityeden.co.uk/colony/example.php | javascript | jquery | null | null | null | null | open | How to merge one animation with another?
===
I recently posted a question regarding moving multiple images and got some advice from Beetroot (Thanks Beetroot!!)
I am trying to animate pictures accross a gameboard.
I have managed to do this using .animate() feature which has a callback function to run the anamation again.
The problem I have is that as each animation runs the image "accelerates" up to "cruising" speed, continues a distance before "decelerating" to a stop, it then starts this process again.
the effect this has is that thwe image moves in sort of surges.
Is it possible to make the animations blur so that the image doesn't "decelerate" between animations?
I have included the code for the animate function below.
I have tried to comment it as best I can and the example of the page can be seen [here][1]. To get it to work click on an "ind" spot and select the "sawmill" upgrade from pop-up.
function WalkTo(ImgID,Crnt_Coord)
{
//ImgID is a cobination of the coordinate the picture started on plus the word "worker".
//Crnt_Coord is the current coordinate the image is on
var index = parseInt(ImgID.replace("worker", ""));
var Image = Animate_Image[index];// this array holds the Ids for the images for the $(Image) jquery code later.
var Current_Coord = Crnt_Coord;
if(Crnt_Coord==Animate_End_Coord[index])
{Animate_Delivered[index]=1;} //checks to see if image has arrived at destination and sets the delivered to 1
if(Crnt_Coord==index)
{Animate_Delivered[index]=0;}// checks to see if image is back at starting location, sets delivered back to 0 so object can start journey again.
var End_Coord;//destination
if(Animate_Delivered[index]==0){End_Coord = Animate_End_Coord[index];}//if image has not arrived it gets the destination from an array
else{End_Coord = index;}//delivered now set to 1 and destination is set as startposition.
//I now run a simple path finding function to determine next move, it returns as a string the next coodinate and the bearing (north,east,south,west)
var bearing_next_coord = Direction(Current_Coord,End_Coord);
var bearing = bearing_next_coord[0];
var Next_Coord = parseInt(bearing_next_coord.substring(1));
var pos = $(Image).position();//Gets the current pixel position of the image
var left = pos.left;
var top = pos.top;
var imgSrc = "images/animations/"+Animate_Job[index]+"_dude_"+bearing+".gif";//changes the image so worker appears to turn
//The switch below then sets the distance and direction for the image to travel in the .animate
switch(bearing)
{
case "n":
top-=60;
break;
case "e":
left+=60;
break;
case "s":
top+=60;
break;
case "w":
left-=60;
break;
}
if(zone_array[Next_Coord]==""){$(Image).attr("src", "images/icons/boat.gif");}//changes image to boat if the image needs to cross water
else{$(Image).attr("src", imgSrc);}//for land use the imgSrc
//finally the animate using the varibles set above, then set the function to run again with new "currentCoordinate"
$(Image).animate({left: left,top: top}, 1500, function(){WalkTo(ImgID,Next_Coord)});
}
Thanks in advance for any help!!
John
[1]: http://tranquilityeden.co.uk/colony/example.php | 0 |
7,666,055 | 10/05/2011 18:41:36 | 686,187 | 03/31/2011 16:50:31 | 3 | 0 | C# abstract class with abstract property of Generic List override | I am trying to use some base Abstract classes for a Transaction, Order and an OrderCollection. TransactionCog inherits Transaction and OrderCollection inherits List<T> and OrderCogCollection inherits OrderCollection<OrderCog> and OrderCog inherits Order. The TransactionCog must have a member of OrderCogCollection.
I am trying to use Transaction to have an abstract Property of OrderCollection so that TransactionCog must override the property but use a type of OrderCogCollection instead. Of course the way I'm going right now is giving me a TransactionCog does not implement inherited abstract member.
I'm trying this so that if I have a Widget or Gear to order next, I inherit from the bases and it forces me to override the property with corresponding Order'ItemName'Collection. Part of the reason for this is each Order'ItemName'Collection will have some of it's own special functions and properties that others will not. I'm just having trouble seeing where I should be going to have this ability work if it's possible.
public abstract class Transaction
{
public abstract OrderCollection<Order> Orders
{ get; set; }
}
public abstract class Order
{
private int _id;
public int ID
{
get { return _id; }
set { _id = value; }
}
}
public abstract class OrderCollection<T> : System.Collections.Generic.List<T>
{
abstract public int GetIntValue(int test);
}
class OrderCog : TestWindowsFormCsharp.Classes.BaseClasses.Order
{
public OrderCog()
{
}
}
public class OrderCogCollection<OrderCog> : TestWindowsFormCsharp.Classes.BaseClasses.OrderCollection<OrderCog>
{
public OrderCogCollection()
{
}
public override int GetIntValue(int test)
{
return test;
}
}
class TransactionCog : TestWindowsFormCsharp.Classes.BaseClasses.Transaction
{
private OrderCogCollection<OrderCog> cogs;
public TransactionCog()
{
}
public override OrderCogCollection<OrderCog> Orders
{
get { return cogs; }
set { cogs = value; }
}
} | c# | list | generics | properties | abstract | null | open | C# abstract class with abstract property of Generic List override
===
I am trying to use some base Abstract classes for a Transaction, Order and an OrderCollection. TransactionCog inherits Transaction and OrderCollection inherits List<T> and OrderCogCollection inherits OrderCollection<OrderCog> and OrderCog inherits Order. The TransactionCog must have a member of OrderCogCollection.
I am trying to use Transaction to have an abstract Property of OrderCollection so that TransactionCog must override the property but use a type of OrderCogCollection instead. Of course the way I'm going right now is giving me a TransactionCog does not implement inherited abstract member.
I'm trying this so that if I have a Widget or Gear to order next, I inherit from the bases and it forces me to override the property with corresponding Order'ItemName'Collection. Part of the reason for this is each Order'ItemName'Collection will have some of it's own special functions and properties that others will not. I'm just having trouble seeing where I should be going to have this ability work if it's possible.
public abstract class Transaction
{
public abstract OrderCollection<Order> Orders
{ get; set; }
}
public abstract class Order
{
private int _id;
public int ID
{
get { return _id; }
set { _id = value; }
}
}
public abstract class OrderCollection<T> : System.Collections.Generic.List<T>
{
abstract public int GetIntValue(int test);
}
class OrderCog : TestWindowsFormCsharp.Classes.BaseClasses.Order
{
public OrderCog()
{
}
}
public class OrderCogCollection<OrderCog> : TestWindowsFormCsharp.Classes.BaseClasses.OrderCollection<OrderCog>
{
public OrderCogCollection()
{
}
public override int GetIntValue(int test)
{
return test;
}
}
class TransactionCog : TestWindowsFormCsharp.Classes.BaseClasses.Transaction
{
private OrderCogCollection<OrderCog> cogs;
public TransactionCog()
{
}
public override OrderCogCollection<OrderCog> Orders
{
get { return cogs; }
set { cogs = value; }
}
} | 0 |
10,862,686 | 06/02/2012 13:31:15 | 1,421,634 | 05/28/2012 11:43:20 | 1 | 0 | how can I make visitor counter in php? | How I can count visitors ??
I want to insert when open the page and when close or leave the page but not onunload
And I don't want to insert when refresh the page
I tried this code not working
if (!isset($_SESSION["visits"]))
$_SESSION["visits"] = 0;
$_SESSION["visits"] = $_SESSION["visits"] + 1;
if ($_SESSION["visits"] > 1){echo "You hit the refresh button!";}
else{
mysql_query(
"INSERT INTO najd_visit( visit_userId, visit_staticId, visit_page,
visit_enterTime)VALUES ('$userId', '$Sid', '$title', '$date') ");
echo "This is my site";
} | php | mysql | counter | visitor-statistic | visitors | 06/03/2012 09:51:28 | too localized | how can I make visitor counter in php?
===
How I can count visitors ??
I want to insert when open the page and when close or leave the page but not onunload
And I don't want to insert when refresh the page
I tried this code not working
if (!isset($_SESSION["visits"]))
$_SESSION["visits"] = 0;
$_SESSION["visits"] = $_SESSION["visits"] + 1;
if ($_SESSION["visits"] > 1){echo "You hit the refresh button!";}
else{
mysql_query(
"INSERT INTO najd_visit( visit_userId, visit_staticId, visit_page,
visit_enterTime)VALUES ('$userId', '$Sid', '$title', '$date') ");
echo "This is my site";
} | 3 |
11,273,811 | 06/30/2012 11:44:53 | 1,492,936 | 06/30/2012 11:35:53 | 1 | 0 | Install Apache and Apache-Tomcat in two server | I plan to install apache and apache-tomcat in different server. apache server will process static content like html and dynamic content will be forward to tomcat server.
I already installed successfull apache and tomcat in 1 server :)
Anybody can give me a solution?
(srr my english not good ;) | apache | tomcat | integrated | null | null | 07/02/2012 22:07:52 | off topic | Install Apache and Apache-Tomcat in two server
===
I plan to install apache and apache-tomcat in different server. apache server will process static content like html and dynamic content will be forward to tomcat server.
I already installed successfull apache and tomcat in 1 server :)
Anybody can give me a solution?
(srr my english not good ;) | 2 |
4,000,435 | 10/22/2010 19:50:09 | 144,088 | 07/23/2009 22:04:08 | 221 | 5 | How to capture audio from a browser? | My client needs to let a user record a message from the browser, then export the message as an audio file (e.g., WAV).
How is this best accomplished? Flash, Java, HTML5? By best, I mean something that is straightforward to implement and also broadly supported.
What are people's experiences using HTML5?
Thanks! | java | flash | html5 | audio | audio-recording | null | open | How to capture audio from a browser?
===
My client needs to let a user record a message from the browser, then export the message as an audio file (e.g., WAV).
How is this best accomplished? Flash, Java, HTML5? By best, I mean something that is straightforward to implement and also broadly supported.
What are people's experiences using HTML5?
Thanks! | 0 |
2,006,045 | 01/05/2010 12:45:54 | 148,978 | 08/01/2009 14:17:54 | 293 | 1 | How can I display the 1 to many and many to 1 relationship in RoR? | I have a table called "order" which has many "order_items" , each "order_items" is belongs_to "order" and "product". In the db, I have one record in order. the record is like this:
orders table: id = 1 name= customer
and the order_items table is like this: id=1 product_id=233 order_id =1
id=2 product_id=454 order_id =1
I have the @orders obj, how can I use the orders and find out the order items and products information? | ruby | ruby-on-rails | entity-relationship | null | null | null | open | How can I display the 1 to many and many to 1 relationship in RoR?
===
I have a table called "order" which has many "order_items" , each "order_items" is belongs_to "order" and "product". In the db, I have one record in order. the record is like this:
orders table: id = 1 name= customer
and the order_items table is like this: id=1 product_id=233 order_id =1
id=2 product_id=454 order_id =1
I have the @orders obj, how can I use the orders and find out the order items and products information? | 0 |
3,616,324 | 09/01/2010 08:44:52 | 113,141 | 05/27/2009 12:53:28 | 7,491 | 387 | Supporting artificial "casting" of generated .Net types | (I applogise in advance for the length of this post, however the problem is fairly complex - hopefully everything is clear however I have simplified the scenario a lot and so there is a good chance that I've missed a vital fact, or there is something that I've not explained.)
<h2>Setting the scene</h2>
I'm using code generation to generate C# wrapper / interop classes for custom types defined in a domain specific language. These custom types support named attributes of various types, and are currently exposed to .Net code as an instance of a `CustomType` class:
// Simple example use of CustomType class
void Test(CustomType widget)
{
string someString = widget.GetString("SomeString");
int myInteger = widget.GetInt("MyInteger");
CustomType gadget = widget.GetCustomType("MyGadget");
}
These types also support a simple inheritance heirachy in that if a custom type "Widget" inherits from another type "Gadget", then an instance of "Widget" will inherit all the attributes defined on the "Gadget" type as well as its own attributes.
Of course if you try to "Get" an attribute of the wrong type (or an attribute that doesn't exist) then things go horribly wrong - my generation process produces a class for each custom type that has generated properties with the correct names / types:
void Test(Widget widget)
{
string someString = widget.SomeString;
int myInteger = widget.MyInteger;
Gadget gadget = widget.MyGadget;
}
I've been using this for a while now and it helps out a lot with catching all the silly type conversion errors at compile time rather than runtime, however there is one remaining thing thats niggling at me:
<h2>How should I support "casting" of these generated types?</h2>
I've also added the ability to cast between these generated custom types, for example:
// Remember that Widget : Gadget
Widget widget = new Widget();
Gadget gadget = widget; // Implicit cast
Widget widget = (Widget)gadget; // Explicit cast
Bucket bucket = (Bucket)widget; // Invalid cast causes compile time error (Bucket is another generated type)
Again all of the above works (using cast operator overloading), however the problem start to come when I don't know what the custom type is:
void Test(CustomType someObject)
{
Widget widget = (widget)someObject;
}
// And (more tricky)
void Test(object someObject)
{
Widget widget = (widget)someObject;
}
As far as I can see I have three ways to implement this:
**1)** If I do the obvious thing and have my generated types inherit from each other and CustomType then I get problems because I can't overload casting between types that inherit from each other:
void Test(CustomType someObject)
{
// If someObject is actually an instance of the .Net CustomType class then the following cast fails
// even if the underlying object is really a widget.
Widget widget = (widget)someObject;
}
This means that casts (such as the above) may or may not fail depending on the way that the custom object is instantiated, which is *incredibly scary*! For various reasons it is very difficult to control the way that these objects are instantiated (for example, most of the time instantiating custom types is done in common assemblies that have no knowledge of the generated types)
2) The alternative that I've gone for is to have none of my generated types inherit from each other and instead generate suitable cast operator overloading methods in each of my generated types, this means that the above example works, however I have problems with unboxing object types:
void Test(object someObject)
{
// Again If someObject is actually an instance of CustomType then the following all goes wrong
Widget widget = (widget)someObject;
}
This is much much better as I can guarentee that casts between generated types will work consistently, and I only need to cast to a custom type from object at a couple of places (and in those cases it is normally safe to assume that it is a `CustomType`), however it *feels* really messy to have all those operator overloads, and casting from `object` is a faff:
void Test(object someObject)
{
Widget widget = (widget)(CustomType)someObject;
}
3) Failing that, I can scrap casting and force people to create new instances of the generated types when they "cast":
void Test(object someObject)
{
Widget widget = new Widget(someObject);
Gadget gadget = new Gadget(widget);
}
But this means I loose the compile time type safety when converting between types (as the objects all need to accept a constructor with an input of type `object`), and looks messy.
My current favourite is #2 - Is there any way to get casting of these generated to work any nicer?
Failing that, has anyone got any alternative suggestions (for example a way of creating instances of the correct wrapper object in assemblies that don't "know" about the generated types?)
| .net | code-generation | dynamic-cast | null | null | null | open | Supporting artificial "casting" of generated .Net types
===
(I applogise in advance for the length of this post, however the problem is fairly complex - hopefully everything is clear however I have simplified the scenario a lot and so there is a good chance that I've missed a vital fact, or there is something that I've not explained.)
<h2>Setting the scene</h2>
I'm using code generation to generate C# wrapper / interop classes for custom types defined in a domain specific language. These custom types support named attributes of various types, and are currently exposed to .Net code as an instance of a `CustomType` class:
// Simple example use of CustomType class
void Test(CustomType widget)
{
string someString = widget.GetString("SomeString");
int myInteger = widget.GetInt("MyInteger");
CustomType gadget = widget.GetCustomType("MyGadget");
}
These types also support a simple inheritance heirachy in that if a custom type "Widget" inherits from another type "Gadget", then an instance of "Widget" will inherit all the attributes defined on the "Gadget" type as well as its own attributes.
Of course if you try to "Get" an attribute of the wrong type (or an attribute that doesn't exist) then things go horribly wrong - my generation process produces a class for each custom type that has generated properties with the correct names / types:
void Test(Widget widget)
{
string someString = widget.SomeString;
int myInteger = widget.MyInteger;
Gadget gadget = widget.MyGadget;
}
I've been using this for a while now and it helps out a lot with catching all the silly type conversion errors at compile time rather than runtime, however there is one remaining thing thats niggling at me:
<h2>How should I support "casting" of these generated types?</h2>
I've also added the ability to cast between these generated custom types, for example:
// Remember that Widget : Gadget
Widget widget = new Widget();
Gadget gadget = widget; // Implicit cast
Widget widget = (Widget)gadget; // Explicit cast
Bucket bucket = (Bucket)widget; // Invalid cast causes compile time error (Bucket is another generated type)
Again all of the above works (using cast operator overloading), however the problem start to come when I don't know what the custom type is:
void Test(CustomType someObject)
{
Widget widget = (widget)someObject;
}
// And (more tricky)
void Test(object someObject)
{
Widget widget = (widget)someObject;
}
As far as I can see I have three ways to implement this:
**1)** If I do the obvious thing and have my generated types inherit from each other and CustomType then I get problems because I can't overload casting between types that inherit from each other:
void Test(CustomType someObject)
{
// If someObject is actually an instance of the .Net CustomType class then the following cast fails
// even if the underlying object is really a widget.
Widget widget = (widget)someObject;
}
This means that casts (such as the above) may or may not fail depending on the way that the custom object is instantiated, which is *incredibly scary*! For various reasons it is very difficult to control the way that these objects are instantiated (for example, most of the time instantiating custom types is done in common assemblies that have no knowledge of the generated types)
2) The alternative that I've gone for is to have none of my generated types inherit from each other and instead generate suitable cast operator overloading methods in each of my generated types, this means that the above example works, however I have problems with unboxing object types:
void Test(object someObject)
{
// Again If someObject is actually an instance of CustomType then the following all goes wrong
Widget widget = (widget)someObject;
}
This is much much better as I can guarentee that casts between generated types will work consistently, and I only need to cast to a custom type from object at a couple of places (and in those cases it is normally safe to assume that it is a `CustomType`), however it *feels* really messy to have all those operator overloads, and casting from `object` is a faff:
void Test(object someObject)
{
Widget widget = (widget)(CustomType)someObject;
}
3) Failing that, I can scrap casting and force people to create new instances of the generated types when they "cast":
void Test(object someObject)
{
Widget widget = new Widget(someObject);
Gadget gadget = new Gadget(widget);
}
But this means I loose the compile time type safety when converting between types (as the objects all need to accept a constructor with an input of type `object`), and looks messy.
My current favourite is #2 - Is there any way to get casting of these generated to work any nicer?
Failing that, has anyone got any alternative suggestions (for example a way of creating instances of the correct wrapper object in assemblies that don't "know" about the generated types?)
| 0 |
4,897,207 | 02/04/2011 10:57:31 | 116,388 | 06/03/2009 06:25:33 | 1,651 | 112 | How drop Ged editors figures in the outside world ? | After long investigations and reading this [question][1] I still didn't get a "good" solution for my problem.
I have a Gef editor and I want to let the users drag and drop figures (== model objects) form this editor to an other custom view available in my perspective.
Adding a DragSource with my own drag transfer on my GEF editor figure canvas allows that. But as a side effect, and I don't want this side effect, this disable the possibility to move the figures INSIDE the editor using drag and drop.
After investigations I found this [post on eclipse forums][2], but the solution is not acceptable for me. Thus I investigated deeper and came to the following pure SWT snippet that shows that MouseMove events (the ones used by gef to support dragging INSIDE the editor) are no more fired once a drag source has been added:
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class SwtTest {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
System.out.println("mouseUp");
}
public void mouseDown(MouseEvent e) {
System.out.println("mouseDown");
}
public void mouseDoubleClick(MouseEvent e) {
System.out.println("mouseDoubleClick");
}
});
shell.addMouseMoveListener(new MouseMoveListener() {
@Override
public void mouseMove(MouseEvent e) {
System.out.println("Mouse move");
}
});
DragSourceListener dragListener = new DragSourceListener() {
public void dragFinished(DragSourceEvent event) {
System.out.println("dragFinished");
}
public void dragSetData(DragSourceEvent event) {
System.out.println("dragSetData");
}
public void dragStart(DragSourceEvent event) {
System.out.println("dragStart");
}
};
DragSource dragSource = new DragSource(shell, DND.DROP_COPY | DND.DROP_MOVE);
dragSource.addDragListener(dragListener);
dragSource.setTransfer(new Transfer[] { FileTransfer.getInstance() });
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
I guess this is the normal behavior fro man SWT point of view. Do you confirm ?
Moreover, I am really looking for a solution to this issue other that the one proposed on Eclipse forum consisting in activating my DragSource only if a given condition is met such as Shift is pressed (this is done in a DragSourceListener.dragStart method by setting event.doit to false)
Any help, suggestions and comments are welcome.
Thanks in advance,
Manu
[1]: http://stackoverflow.com/questions/3908290/mousedown-events-are-not-delivered-until-mouseup-when-a-drag-source-is-present
[2]: http://www.eclipse.org/forums/index.php?t=tree&goto=210598&S=4f8538b21a7b45ef81bbcbb6675b8c08#page_top | java | eclipse | drag-and-drop | swt | gef | null | open | How drop Ged editors figures in the outside world ?
===
After long investigations and reading this [question][1] I still didn't get a "good" solution for my problem.
I have a Gef editor and I want to let the users drag and drop figures (== model objects) form this editor to an other custom view available in my perspective.
Adding a DragSource with my own drag transfer on my GEF editor figure canvas allows that. But as a side effect, and I don't want this side effect, this disable the possibility to move the figures INSIDE the editor using drag and drop.
After investigations I found this [post on eclipse forums][2], but the solution is not acceptable for me. Thus I investigated deeper and came to the following pure SWT snippet that shows that MouseMove events (the ones used by gef to support dragging INSIDE the editor) are no more fired once a drag source has been added:
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class SwtTest {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
System.out.println("mouseUp");
}
public void mouseDown(MouseEvent e) {
System.out.println("mouseDown");
}
public void mouseDoubleClick(MouseEvent e) {
System.out.println("mouseDoubleClick");
}
});
shell.addMouseMoveListener(new MouseMoveListener() {
@Override
public void mouseMove(MouseEvent e) {
System.out.println("Mouse move");
}
});
DragSourceListener dragListener = new DragSourceListener() {
public void dragFinished(DragSourceEvent event) {
System.out.println("dragFinished");
}
public void dragSetData(DragSourceEvent event) {
System.out.println("dragSetData");
}
public void dragStart(DragSourceEvent event) {
System.out.println("dragStart");
}
};
DragSource dragSource = new DragSource(shell, DND.DROP_COPY | DND.DROP_MOVE);
dragSource.addDragListener(dragListener);
dragSource.setTransfer(new Transfer[] { FileTransfer.getInstance() });
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
I guess this is the normal behavior fro man SWT point of view. Do you confirm ?
Moreover, I am really looking for a solution to this issue other that the one proposed on Eclipse forum consisting in activating my DragSource only if a given condition is met such as Shift is pressed (this is done in a DragSourceListener.dragStart method by setting event.doit to false)
Any help, suggestions and comments are welcome.
Thanks in advance,
Manu
[1]: http://stackoverflow.com/questions/3908290/mousedown-events-are-not-delivered-until-mouseup-when-a-drag-source-is-present
[2]: http://www.eclipse.org/forums/index.php?t=tree&goto=210598&S=4f8538b21a7b45ef81bbcbb6675b8c08#page_top | 0 |
3,615,581 | 09/01/2010 06:41:00 | 420,261 | 08/14/2010 08:24:31 | 13 | 1 | footer View issue in android | In my android app when the no of items in the list is small the footer sticks to end of the list like the one shown below.
![alt text][1]
[1]: http://i.stack.imgur.com/ALHtm.png
but not to the end of screen.
Is there any way that i can stick it to the bottom of the screen.
I am using a seperate footer.xml and am calling it using Inflator service.
Please share your valuable suggestions.
Thanks in advance:) | android | null | null | null | null | null | open | footer View issue in android
===
In my android app when the no of items in the list is small the footer sticks to end of the list like the one shown below.
![alt text][1]
[1]: http://i.stack.imgur.com/ALHtm.png
but not to the end of screen.
Is there any way that i can stick it to the bottom of the screen.
I am using a seperate footer.xml and am calling it using Inflator service.
Please share your valuable suggestions.
Thanks in advance:) | 0 |
11,258,715 | 06/29/2012 08:49:09 | 117,953 | 06/05/2009 12:02:00 | 39 | 3 | Employment Benefits for Developers | I am the development manager for a small development company (around 15 developers) and I have been pushing for an increase in benefits for the developers in order to compete with other larger businesses for developers. The directors have asked me to come up with a list of ideas for what I want - I was just wondering what interesting / innovative benefits people have in other organisations and what developers in general find the most important. I am also interested in finding out about any developer specific bonus schemes people may have.
Currently we have good pay and qualitative bonus scheme, top spec machines to work on with three monitors and pretty much nothing else.
I am pushing for flexible working hours which the company currently does not allow at all as the biggest must have. The directors want to give everyone iPads / smartphones, health insurance and some kind of pension scheme.
What other benefits have worked well in your organisation / are most important for developers? | benefits | null | null | null | null | 06/29/2012 15:20:58 | off topic | Employment Benefits for Developers
===
I am the development manager for a small development company (around 15 developers) and I have been pushing for an increase in benefits for the developers in order to compete with other larger businesses for developers. The directors have asked me to come up with a list of ideas for what I want - I was just wondering what interesting / innovative benefits people have in other organisations and what developers in general find the most important. I am also interested in finding out about any developer specific bonus schemes people may have.
Currently we have good pay and qualitative bonus scheme, top spec machines to work on with three monitors and pretty much nothing else.
I am pushing for flexible working hours which the company currently does not allow at all as the biggest must have. The directors want to give everyone iPads / smartphones, health insurance and some kind of pension scheme.
What other benefits have worked well in your organisation / are most important for developers? | 2 |
2,974,280 | 06/04/2010 12:54:01 | 272,590 | 02/13/2010 23:14:58 | 106 | 2 | HTML to EXCEL -> simple question | O have a ,,export to excel" function, I have some tables and it works fine, but I have one single problem.
For moving to the next line I use <br />, but what if I want to switch to the next column? What tag can I use to switch to the next column?
Thanks | html | excel | null | null | null | null | open | HTML to EXCEL -> simple question
===
O have a ,,export to excel" function, I have some tables and it works fine, but I have one single problem.
For moving to the next line I use <br />, but what if I want to switch to the next column? What tag can I use to switch to the next column?
Thanks | 0 |
6,323,304 | 06/12/2011 17:11:12 | 471,196 | 10/09/2010 22:06:41 | 340 | 9 | Creating and using Linux/Unix C/C++ Daemon | Using C++ how do I create a daemon, a lock file, redirect stdio to log files, etc and then talk to and from it on another process. I'm using ubuntu and arch Linux. I would prefer to stick to the std library. | c++ | c | daemon | null | null | 06/12/2011 17:28:37 | not a real question | Creating and using Linux/Unix C/C++ Daemon
===
Using C++ how do I create a daemon, a lock file, redirect stdio to log files, etc and then talk to and from it on another process. I'm using ubuntu and arch Linux. I would prefer to stick to the std library. | 1 |
5,223,653 | 03/07/2011 18:35:01 | 273,657 | 02/15/2010 16:39:46 | 536 | 13 | Comparing values of type DATE - Oracle | Is there any way of comparing to date values to check if one is before the other?
For example how do i know which came first on the following rows
SEQ CREATION_DTM
--------------------
234 2011-03-26 22:59:03
235 2011-03-26 22:59:03
The column for the above data is declarad as datatype DATE. Having read around it appears that the DATE datatype does not store milliseconds. Does this mean
i cant compare the above two dates to find out which one is before the other?
EDIT
-----
I am using Oracle 10G on Solaris.
| sql | oracle | plsql | oracle10g | null | null | open | Comparing values of type DATE - Oracle
===
Is there any way of comparing to date values to check if one is before the other?
For example how do i know which came first on the following rows
SEQ CREATION_DTM
--------------------
234 2011-03-26 22:59:03
235 2011-03-26 22:59:03
The column for the above data is declarad as datatype DATE. Having read around it appears that the DATE datatype does not store milliseconds. Does this mean
i cant compare the above two dates to find out which one is before the other?
EDIT
-----
I am using Oracle 10G on Solaris.
| 0 |
3,437,171 | 08/09/2010 03:35:19 | 373,908 | 06/23/2010 05:52:19 | 39 | 0 | how to calculate "consecutive mean" in R without using loop, or in a more efficient way? | I have a set a data that I need to calculate their "consecutive mean" (I dunno if it is the correct name, but I can't find anything better), here is an example:
ID Var2 Var3
1 A 1
2 A 3
3 A 5
4 A 7
5 A 9
6 A 11
7 B 2
8 B 4
9 B 6
10 B 8
11 B 10
Here I need to calculated the mean of 3 Var3 variable in the same subset consecutively (i.e. there will be 4 means caulculated for A: mean(1,3,5), mean(3,5,7), mean(5,7,9), mean(7,9,11), and 3 means calculated for B: mean(2,4,6), mean(4,6,8), mean(6,8,10). And the result should be:
ID Var2 Var3 Mean
1 A 1 N/A
2 A 3 N/A
3 A 5 3
4 A 7 5
5 A 9 7
6 A 11 9
7 B 2 N/A
8 B 4 N/A
9 B 6 4
10 B 8 6
11 B 10 8
Currently I am using a "loop-inside-a-loop" approach, I subset the dataset using Var2, and then I calculated the mean in another start from the third data.
It suits what I need, but it is very slow, is there any faster way for this problem?
Thanks! | optimization | r | loops | null | null | null | open | how to calculate "consecutive mean" in R without using loop, or in a more efficient way?
===
I have a set a data that I need to calculate their "consecutive mean" (I dunno if it is the correct name, but I can't find anything better), here is an example:
ID Var2 Var3
1 A 1
2 A 3
3 A 5
4 A 7
5 A 9
6 A 11
7 B 2
8 B 4
9 B 6
10 B 8
11 B 10
Here I need to calculated the mean of 3 Var3 variable in the same subset consecutively (i.e. there will be 4 means caulculated for A: mean(1,3,5), mean(3,5,7), mean(5,7,9), mean(7,9,11), and 3 means calculated for B: mean(2,4,6), mean(4,6,8), mean(6,8,10). And the result should be:
ID Var2 Var3 Mean
1 A 1 N/A
2 A 3 N/A
3 A 5 3
4 A 7 5
5 A 9 7
6 A 11 9
7 B 2 N/A
8 B 4 N/A
9 B 6 4
10 B 8 6
11 B 10 8
Currently I am using a "loop-inside-a-loop" approach, I subset the dataset using Var2, and then I calculated the mean in another start from the third data.
It suits what I need, but it is very slow, is there any faster way for this problem?
Thanks! | 0 |
2,503,333 | 03/23/2010 20:24:47 | 62,642 | 02/04/2009 21:52:05 | 1,554 | 95 | Microsoft WPF Certification | I'm seriously thinking about getting this certification. I already contacted [Apex InfoTech][1] and they gave me prices and everything.
This is the [description of the course.][2]
It lasts for 3 days, and the price is $1,495. What do you guys think, is it worth it? I've already been used WPF for a year, but I think a little Microsoft Certification would be good for my business card and resume. Let me know what you think. Thanks!
[1]: http://www.oneapex.com/
[2]: http://www.oneapex.com/microsoftshed/6460.asp | certification | microsoft | null | null | null | 02/21/2012 19:20:24 | not constructive | Microsoft WPF Certification
===
I'm seriously thinking about getting this certification. I already contacted [Apex InfoTech][1] and they gave me prices and everything.
This is the [description of the course.][2]
It lasts for 3 days, and the price is $1,495. What do you guys think, is it worth it? I've already been used WPF for a year, but I think a little Microsoft Certification would be good for my business card and resume. Let me know what you think. Thanks!
[1]: http://www.oneapex.com/
[2]: http://www.oneapex.com/microsoftshed/6460.asp | 4 |
7,315,278 | 09/06/2011 05:24:32 | 113,124 | 05/27/2009 12:28:44 | 6,085 | 44 | What is the equivalent of bash export in Perl? |
I am converting a bash script to Perl. I am not sure what the equivalent of an `export` is.
LOC=/tmp/1/
export LOC
For example, for the above two lines, what would be the equivalent Perl code?
my $LOC = '/tmp/1/';
# what should go here? | perl | bash | export | null | null | null | open | What is the equivalent of bash export in Perl?
===
I am converting a bash script to Perl. I am not sure what the equivalent of an `export` is.
LOC=/tmp/1/
export LOC
For example, for the above two lines, what would be the equivalent Perl code?
my $LOC = '/tmp/1/';
# what should go here? | 0 |
9,699,227 | 03/14/2012 09:35:34 | 455,268 | 04/23/2010 07:17:28 | 433 | 11 | Replace bunch of symbols in PHP | I have a string with bunch of special characters/symbols and I want to replace them with some other strings. For example `$` should became `_dollar`, `,` should become `_comma`, `(` `_openparenthesis`, `)` `_closeparenthesis` and so on.
Is this the best approach or I can replace them all in "one move" *(*there are more symbols, I didn't put them all in here)*?
public function replaceSymbols() {
$codedVersion = $this->getBody();
$replacementArray = array(
'$' => '_dollar',
',' => '_comma',
'(' => '_openparenthesis',
')' => '_closeparenthesis',
'[' => '_opensquarebrackets',
']' => '_closesquarebrackets',
'{' => '_opencurlybrackets',
'}' => '_closecurlybrackets'
);
foreach($replacementArray as $key => $value)
$codedVersion = str_replace($key, $value, $codedVersion);
return $codedVersion;
} | php | replace | null | null | null | null | open | Replace bunch of symbols in PHP
===
I have a string with bunch of special characters/symbols and I want to replace them with some other strings. For example `$` should became `_dollar`, `,` should become `_comma`, `(` `_openparenthesis`, `)` `_closeparenthesis` and so on.
Is this the best approach or I can replace them all in "one move" *(*there are more symbols, I didn't put them all in here)*?
public function replaceSymbols() {
$codedVersion = $this->getBody();
$replacementArray = array(
'$' => '_dollar',
',' => '_comma',
'(' => '_openparenthesis',
')' => '_closeparenthesis',
'[' => '_opensquarebrackets',
']' => '_closesquarebrackets',
'{' => '_opencurlybrackets',
'}' => '_closecurlybrackets'
);
foreach($replacementArray as $key => $value)
$codedVersion = str_replace($key, $value, $codedVersion);
return $codedVersion;
} | 0 |
1,262,930 | 08/11/2009 21:08:18 | 153,799 | 08/10/2009 15:19:15 | 6 | 0 | Jquery empty() div exept for matched elements | Is there a way to empty a div leaving only elements with an specific class name?
Or, is there a way to remove all elements within a div leaving only elements with a specified class? | jquery | empty | remove | null | null | null | open | Jquery empty() div exept for matched elements
===
Is there a way to empty a div leaving only elements with an specific class name?
Or, is there a way to remove all elements within a div leaving only elements with a specified class? | 0 |
11,307,060 | 07/03/2012 08:22:18 | 1,331,587 | 04/13/2012 12:35:23 | 1 | 0 | How to convert image file to text in vb.net OCR | Anyone have good recommendations for vb.net compatible component to read image files to text files? OCR-konverting
Basicly I just need to convert numbers from images. But the sowtware should be as good as possible to regognize different kind of numbers (different fonts). | vb.net | ocr | convert | null | null | 07/04/2012 22:15:24 | not constructive | How to convert image file to text in vb.net OCR
===
Anyone have good recommendations for vb.net compatible component to read image files to text files? OCR-konverting
Basicly I just need to convert numbers from images. But the sowtware should be as good as possible to regognize different kind of numbers (different fonts). | 4 |
9,184,289 | 02/07/2012 21:32:31 | 1,195,774 | 02/07/2012 21:29:14 | 1 | 0 | Extracting links from html source code | i needed to extract certain format links from the html source code....
e.g.
text = <a class='rightnavthumbtext' href='gallery.php?id=11'><b>Recent Work</b>
the script should extract only gallery.php?id=11 and so on
the script should extract all the links from the source code and display using loop
| php | preg-match-all | null | null | null | 02/07/2012 22:22:51 | not a real question | Extracting links from html source code
===
i needed to extract certain format links from the html source code....
e.g.
text = <a class='rightnavthumbtext' href='gallery.php?id=11'><b>Recent Work</b>
the script should extract only gallery.php?id=11 and so on
the script should extract all the links from the source code and display using loop
| 1 |
9,631,619 | 03/09/2012 09:23:15 | 1,258,910 | 03/09/2012 09:03:58 | 1 | 0 | Read words from mp3 file with C# | I want to write a program that will take a mp3 file as a input and output will be the words that are available in that mp3 file. For example, I have a file name test.mp3, that contains some sentences (e.g. how are you? I am fine. What is your name?), now I want to parse the mp3 file so that I can get all words/sentence that are available in test.mp3 file. I prefer .NET(c#) code.
If file format is .wav, then It is okay for me.
Please help me about the issue.
-Thanks,
Arefin
| c# | word | mp3 | extract | null | 03/09/2012 20:29:58 | not a real question | Read words from mp3 file with C#
===
I want to write a program that will take a mp3 file as a input and output will be the words that are available in that mp3 file. For example, I have a file name test.mp3, that contains some sentences (e.g. how are you? I am fine. What is your name?), now I want to parse the mp3 file so that I can get all words/sentence that are available in test.mp3 file. I prefer .NET(c#) code.
If file format is .wav, then It is okay for me.
Please help me about the issue.
-Thanks,
Arefin
| 1 |
9,857,140 | 03/25/2012 01:14:27 | 1,068,546 | 11/28/2011 01:27:28 | 462 | 17 | ActonBar not working | I'm trying to enable `ActionBar` in an `Activity`.
Here's my `Manifest`.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.assistant.lab.royale"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="15"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LabAssistant"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and here's the code :
.....
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.abmenu, menu);
return true;
}
.....
I'm following the guide over here. The `ActionBar` menu should show up now according to the guide but all I'm getting is the old options menu. Why? | android | null | null | null | null | null | open | ActonBar not working
===
I'm trying to enable `ActionBar` in an `Activity`.
Here's my `Manifest`.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.assistant.lab.royale"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="15"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LabAssistant"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and here's the code :
.....
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.abmenu, menu);
return true;
}
.....
I'm following the guide over here. The `ActionBar` menu should show up now according to the guide but all I'm getting is the old options menu. Why? | 0 |
6,699,558 | 07/14/2011 20:32:26 | 839,609 | 07/11/2011 20:26:49 | 1 | 0 | What are some open source android games that are easy to edit/work with? | I am starting to work with android and eclipse, and i was wondering if there are any opensource games available that are easy to edit/work with.
thanks | android | fun | gaming | null | null | 08/07/2011 14:43:26 | off topic | What are some open source android games that are easy to edit/work with?
===
I am starting to work with android and eclipse, and i was wondering if there are any opensource games available that are easy to edit/work with.
thanks | 2 |
10,515,481 | 05/09/2012 11:49:44 | 983,666 | 10/07/2011 08:58:44 | 105 | 1 | Loading nib file for universal application | I an universal application how to create and load a nib file programmatically? How to connect the objects outlet in the new nib file? Or every time i have to check whether the device is iPhone or iPad and accordingly place the objects? | objective-c | ios | cocoa-touch | nib | null | null | open | Loading nib file for universal application
===
I an universal application how to create and load a nib file programmatically? How to connect the objects outlet in the new nib file? Or every time i have to check whether the device is iPhone or iPad and accordingly place the objects? | 0 |
11,102,597 | 06/19/2012 13:58:49 | 1,466,627 | 06/19/2012 13:52:19 | 1 | 0 | Changing code generated model naming convention | When I create EF model, with a child and parent table, the code generation Model -> Database creates a naming convention that I do not like.
If I have Parent table, and Child table inherits from Parent table, for the database script it generates Parent1 table and Parent1_Child table, instead of Parent table and Child table.
How do I fix it, so that when the "Generate Database from Model" is used it generates the naming that I want? | c# | oracle | entity-framework | inheritance | null | null | open | Changing code generated model naming convention
===
When I create EF model, with a child and parent table, the code generation Model -> Database creates a naming convention that I do not like.
If I have Parent table, and Child table inherits from Parent table, for the database script it generates Parent1 table and Parent1_Child table, instead of Parent table and Child table.
How do I fix it, so that when the "Generate Database from Model" is used it generates the naming that I want? | 0 |
9,497,209 | 02/29/2012 10:15:11 | 1,126,194 | 01/02/2012 12:05:20 | 1 | 0 | netbeans ide 6.9.1 didnt recognize jar | I add a jar to my library what i have to do to have the program recognize the classes?
>**--download package.jar--** | java | null | null | null | null | 02/29/2012 16:35:27 | not a real question | netbeans ide 6.9.1 didnt recognize jar
===
I add a jar to my library what i have to do to have the program recognize the classes?
>**--download package.jar--** | 1 |
6,919,988 | 08/02/2011 23:32:53 | 875,625 | 08/02/2011 23:32:53 | 1 | 0 | How to change what sed thinks is the line delimiter | As I'm new with sed, I'm having the fun of seeing that sed doesn't think that the \r character is a valid line delimiter.
Does anyone know how to tell sed which character(s) I'd like it to use as the line delimiter when processing many lines of text?
Thanks in advance,
- Alex | sed | null | null | null | null | null | open | How to change what sed thinks is the line delimiter
===
As I'm new with sed, I'm having the fun of seeing that sed doesn't think that the \r character is a valid line delimiter.
Does anyone know how to tell sed which character(s) I'd like it to use as the line delimiter when processing many lines of text?
Thanks in advance,
- Alex | 0 |
5,659,132 | 04/14/2011 05:55:12 | 707,323 | 04/14/2011 05:27:31 | 1 | 0 | Wordpress, Droopal, or Joomla? Which do you recommend and why? | I'm a graphic designer during the day and a novice web designer on the side with some html and flash knowledge. I don't know CSS or anything else.
I have a client who wants to be able to edit their website themselves in the future. So I can't decide...
Wordpress, Drupal, or Joomla? Which do you recommend and why?
Details please! Thanks!! | wordpress | drupal | website | content-management-system | joomla | 04/14/2011 12:39:07 | not constructive | Wordpress, Droopal, or Joomla? Which do you recommend and why?
===
I'm a graphic designer during the day and a novice web designer on the side with some html and flash knowledge. I don't know CSS or anything else.
I have a client who wants to be able to edit their website themselves in the future. So I can't decide...
Wordpress, Drupal, or Joomla? Which do you recommend and why?
Details please! Thanks!! | 4 |
5,254,585 | 03/10/2011 01:57:58 | 173,520 | 09/15/2009 05:18:28 | 2,306 | 23 | why is the "sizeToFit" call required in this code? | Anyone able to highlight why the "[aLabel sizeToFit]" line is required in this code below, taken from [here][1].
That is, the CGRect created has already been sized based on the text font size, so why would the sizeToFit be required? Or is it because whilst they calculated the correct CGRect size they actually didn't set the pre-agreed font (system font) to the UILabel yet? (and therefore effectively called sizeToFit instead of setting the font)
- (CGRect)RAD_frameForCellLabelWithSystemFontOfSize:(CGFloat)size {
CGFloat width = [UIScreen mainScreen].bounds.size.width - 50;
CGFloat height = [self RAD_textHeightForSystemFontOfSize:size] + 10.0;
return CGRectMake(10.0f, 10.0f, width, height);
}
- (void)RAD_resizeLabel:(UILabel *)aLabel WithSystemFontOfSize:(CGFloat)size {
aLabel.frame = [self RAD_frameForCellLabelWithSystemFontOfSize:size];
aLabel.text = self;
[aLabel sizeToFit]; // WHY IS THIS REQUIRED
}
[1]: http://www.raddonline.com/blogs/geek-journal/iphone-sdk-resizing-a-uitableviewcell-to-hold-variable-amounts-of-text/ | iphone | ios | uilabel | sizetofit | null | null | open | why is the "sizeToFit" call required in this code?
===
Anyone able to highlight why the "[aLabel sizeToFit]" line is required in this code below, taken from [here][1].
That is, the CGRect created has already been sized based on the text font size, so why would the sizeToFit be required? Or is it because whilst they calculated the correct CGRect size they actually didn't set the pre-agreed font (system font) to the UILabel yet? (and therefore effectively called sizeToFit instead of setting the font)
- (CGRect)RAD_frameForCellLabelWithSystemFontOfSize:(CGFloat)size {
CGFloat width = [UIScreen mainScreen].bounds.size.width - 50;
CGFloat height = [self RAD_textHeightForSystemFontOfSize:size] + 10.0;
return CGRectMake(10.0f, 10.0f, width, height);
}
- (void)RAD_resizeLabel:(UILabel *)aLabel WithSystemFontOfSize:(CGFloat)size {
aLabel.frame = [self RAD_frameForCellLabelWithSystemFontOfSize:size];
aLabel.text = self;
[aLabel sizeToFit]; // WHY IS THIS REQUIRED
}
[1]: http://www.raddonline.com/blogs/geek-journal/iphone-sdk-resizing-a-uitableviewcell-to-hold-variable-amounts-of-text/ | 0 |
10,680,804 | 05/21/2012 07:06:41 | 1,204,772 | 02/12/2012 06:26:01 | 14 | 1 | Best Facebook Library for Android | I have checked the official Facebook Library, I do not want to use it, I want to know if there are any alternatives or rather the best alternatives.
| android | facebook | null | null | null | 05/21/2012 10:07:28 | not a real question | Best Facebook Library for Android
===
I have checked the official Facebook Library, I do not want to use it, I want to know if there are any alternatives or rather the best alternatives.
| 1 |
4,387,048 | 12/08/2010 11:47:47 | 365,752 | 06/13/2010 15:37:24 | 143 | 17 | Alternative to SEOmoz SEO Tools Software | Alternative to SEOmoz
I’m looking for an alternative to SEOmoz, if there is one? – I’m happy paying but not as much as what they charge, I can’t really justify it.
One key tool I like about SEOmoz is the RankChecker where you can save this in a profile and it automatically emails weekly results.
Does anybody know of a good alternative?
| seo | software-tools | null | null | null | 05/11/2011 16:09:24 | off topic | Alternative to SEOmoz SEO Tools Software
===
Alternative to SEOmoz
I’m looking for an alternative to SEOmoz, if there is one? – I’m happy paying but not as much as what they charge, I can’t really justify it.
One key tool I like about SEOmoz is the RankChecker where you can save this in a profile and it automatically emails weekly results.
Does anybody know of a good alternative?
| 2 |
9,102,540 | 02/01/2012 20:09:16 | 843,270 | 07/13/2011 18:13:39 | 57 | 1 | Must an Akka actor distinguish whether, when a message is passed, a returned future is expected? | As I understand it, an actor can be sent a message "fire and forget" style with the ! operator, or "Send-And-Receive-Future" style with the ? operator. An actor that is passed a message via ? must call a self.reply or the sender will receive a timeout exception. On the other hand, an actor that is passed a message via ! cannot have self.reply if the message is not being passed from another actor.
My question is, is the Actor supposed to know at compile time whether it will be invoked with ! or ? ??? Or if the necessity of self.reply can be determined at runtime, how can this be determined? Perhaps self.tryReply is involved, but the akka documentation seems to imply that a failed attempt to reply is an error case, whereas if the sender is not an actor, it is not really an error to fail to reply if the message is passed with ! | akka | actor | null | null | null | null | open | Must an Akka actor distinguish whether, when a message is passed, a returned future is expected?
===
As I understand it, an actor can be sent a message "fire and forget" style with the ! operator, or "Send-And-Receive-Future" style with the ? operator. An actor that is passed a message via ? must call a self.reply or the sender will receive a timeout exception. On the other hand, an actor that is passed a message via ! cannot have self.reply if the message is not being passed from another actor.
My question is, is the Actor supposed to know at compile time whether it will be invoked with ! or ? ??? Or if the necessity of self.reply can be determined at runtime, how can this be determined? Perhaps self.tryReply is involved, but the akka documentation seems to imply that a failed attempt to reply is an error case, whereas if the sender is not an actor, it is not really an error to fail to reply if the message is passed with ! | 0 |
8,425,060 | 12/08/2011 01:31:03 | 998,226 | 10/16/2011 20:51:14 | 3 | 0 | Configuring an Internet on loopback interface with Cisco IOS | How can an Internet connection be configured on the loopback interface using Cisco IOS? | ios | cisco | loopback | null | null | 12/08/2011 03:53:53 | off topic | Configuring an Internet on loopback interface with Cisco IOS
===
How can an Internet connection be configured on the loopback interface using Cisco IOS? | 2 |
10,744,876 | 05/24/2012 20:33:48 | 1,233,794 | 02/26/2012 12:41:30 | 146 | 14 | For Loop Objective C | Why do I get this as a result to this code?
**CODE**
ids = 0;
for (NSString *s in golferThreeIconCounter) {
ids++;
NSLog(@"%i", ids);
}
**RESULT**
2012-05-24 16:30:35.194 Dot Golf Scoring[673:f803] 4
2012-05-24 16:30:35.196 Dot Golf Scoring[673:f803] 8
2012-05-24 16:30:35.196 Dot Golf Scoring[673:f803] 12
2012-05-24 16:30:35.197 Dot Golf Scoring[673:f803] 16
2012-05-24 16:30:35.197 Dot Golf Scoring[673:f803] 20
2012-05-24 16:30:35.198 Dot Golf Scoring[673:f803] 24
2012-05-24 16:30:35.199 Dot Golf Scoring[673:f803] 28
2012-05-24 16:30:35.199 Dot Golf Scoring[673:f803] 32
2012-05-24 16:30:35.200 Dot Golf Scoring[673:f803] 36
2012-05-24 16:30:35.200 Dot Golf Scoring[673:f803] 40
2012-05-24 16:30:35.201 Dot Golf Scoring[673:f803] 44
2012-05-24 16:30:35.201 Dot Golf Scoring[673:f803] 48
2012-05-24 16:30:35.202 Dot Golf Scoring[673:f803] 52
2012-05-24 16:30:35.202 Dot Golf Scoring[673:f803] 56
2012-05-24 16:30:35.203 Dot Golf Scoring[673:f803] 60
It makes absolutely no sense to me why ids goes up 4 times instead of just once... | iphone | objective-c | ios | cocoa-touch | ios5 | null | open | For Loop Objective C
===
Why do I get this as a result to this code?
**CODE**
ids = 0;
for (NSString *s in golferThreeIconCounter) {
ids++;
NSLog(@"%i", ids);
}
**RESULT**
2012-05-24 16:30:35.194 Dot Golf Scoring[673:f803] 4
2012-05-24 16:30:35.196 Dot Golf Scoring[673:f803] 8
2012-05-24 16:30:35.196 Dot Golf Scoring[673:f803] 12
2012-05-24 16:30:35.197 Dot Golf Scoring[673:f803] 16
2012-05-24 16:30:35.197 Dot Golf Scoring[673:f803] 20
2012-05-24 16:30:35.198 Dot Golf Scoring[673:f803] 24
2012-05-24 16:30:35.199 Dot Golf Scoring[673:f803] 28
2012-05-24 16:30:35.199 Dot Golf Scoring[673:f803] 32
2012-05-24 16:30:35.200 Dot Golf Scoring[673:f803] 36
2012-05-24 16:30:35.200 Dot Golf Scoring[673:f803] 40
2012-05-24 16:30:35.201 Dot Golf Scoring[673:f803] 44
2012-05-24 16:30:35.201 Dot Golf Scoring[673:f803] 48
2012-05-24 16:30:35.202 Dot Golf Scoring[673:f803] 52
2012-05-24 16:30:35.202 Dot Golf Scoring[673:f803] 56
2012-05-24 16:30:35.203 Dot Golf Scoring[673:f803] 60
It makes absolutely no sense to me why ids goes up 4 times instead of just once... | 0 |
1,950,299 | 12/23/2009 02:00:52 | 233,421 | 12/17/2009 00:41:31 | 44 | 0 | Is it worth learning Python over Ruby and PHP for Web Development? | Is it worth learning Python over Ruby and PHP for Web Development? If so why?
Thank you in advance. | php | ruby | python | web-applications | null | 12/23/2009 02:19:10 | not constructive | Is it worth learning Python over Ruby and PHP for Web Development?
===
Is it worth learning Python over Ruby and PHP for Web Development? If so why?
Thank you in advance. | 4 |
11,560,653 | 07/19/2012 12:14:24 | 208,769 | 11/11/2009 15:19:12 | 444 | 10 | What can cause IE7 to crash? | I'm unable to find an authoritative list of HTML and JS code snippets that can cause IE7 to crash.
I am currently trying to debug an issue, and would like a checklist of things to test and try.
I would suggest that if people know of such a list, please link to it in the comments.
Otherwise, one technique per answer - including the minimum code to reproduce it, that way hopefully the most commonly encountered techniques should bubble to the top. | crash | internet-explorer-7 | null | null | null | 07/24/2012 11:09:02 | not constructive | What can cause IE7 to crash?
===
I'm unable to find an authoritative list of HTML and JS code snippets that can cause IE7 to crash.
I am currently trying to debug an issue, and would like a checklist of things to test and try.
I would suggest that if people know of such a list, please link to it in the comments.
Otherwise, one technique per answer - including the minimum code to reproduce it, that way hopefully the most commonly encountered techniques should bubble to the top. | 4 |
9,864,562 | 03/25/2012 22:12:26 | 1,291,863 | 03/25/2012 22:02:48 | 1 | 0 | Is it possible to make a xp folder impossible to be opened? | Is it possible maybe by means of c/c# (i know i can zip with the password but i want the folder to appear to be a normal folder). Thanx!
| windows-xp | null | null | null | null | 03/26/2012 04:59:46 | not a real question | Is it possible to make a xp folder impossible to be opened?
===
Is it possible maybe by means of c/c# (i know i can zip with the password but i want the folder to appear to be a normal folder). Thanx!
| 1 |
11,256,316 | 06/29/2012 05:04:30 | 1,369,543 | 05/02/2012 08:45:52 | 11 | 0 | How to search character with space in python? | I have a text file contains A B C D like characters with space, I wanted to search A with Space also How can I do this in Python | python-2.7 | null | null | null | null | 06/30/2012 20:54:28 | not a real question | How to search character with space in python?
===
I have a text file contains A B C D like characters with space, I wanted to search A with Space also How can I do this in Python | 1 |
11,399,547 | 07/09/2012 16:46:30 | 1,331,044 | 04/13/2012 08:11:02 | 13 | 0 | opencv still able to open mpeg? | I was wondering about that since I've upgraded to 2.3.1 and it's been a long time I opened mpeg files (extension .mpeg) with it and now I can't do so anymore. I'm not sure if it is due to the upgrade or to the changes I made to my application. Someone know? Perhpas adding some lib will help? | file | opencv | open | mpeg | null | null | open | opencv still able to open mpeg?
===
I was wondering about that since I've upgraded to 2.3.1 and it's been a long time I opened mpeg files (extension .mpeg) with it and now I can't do so anymore. I'm not sure if it is due to the upgrade or to the changes I made to my application. Someone know? Perhpas adding some lib will help? | 0 |
8,780,289 | 01/08/2012 18:59:15 | 719,888 | 04/22/2011 00:57:36 | 180 | 9 | Single-page vs multi-page web apps? | What are the pros and cons? (and dont say single page is slower at loading! it's not if done right) | javascript | html | null | null | null | 01/08/2012 19:10:59 | not constructive | Single-page vs multi-page web apps?
===
What are the pros and cons? (and dont say single page is slower at loading! it's not if done right) | 4 |
8,245,124 | 11/23/2011 15:51:03 | 768,472 | 05/24/2011 20:23:16 | 506 | 17 | Xcode 4 converting to Universal - separation of resources? | According to other threads on this subject, when you select 'Universal' from the Target Devices drop down menu, it should create a Resource-iPad folder. Alternately, I read that you can duplicate an existing target with an option to transition to iPad or to transition to Universal.
However, neither of these behaviors occurs for me. I can set it as Universal, but since there is still only one target, how do you separate which resources are for the iPhone version and which are for iPad?
Additionally, how do you separate where the launch images and app icons go for each version? | iphone | ios | xcode | ipad | null | null | open | Xcode 4 converting to Universal - separation of resources?
===
According to other threads on this subject, when you select 'Universal' from the Target Devices drop down menu, it should create a Resource-iPad folder. Alternately, I read that you can duplicate an existing target with an option to transition to iPad or to transition to Universal.
However, neither of these behaviors occurs for me. I can set it as Universal, but since there is still only one target, how do you separate which resources are for the iPhone version and which are for iPad?
Additionally, how do you separate where the launch images and app icons go for each version? | 0 |
11,374,937 | 07/07/2012 12:19:27 | 1,397,723 | 05/16/2012 05:07:59 | 3 | 0 | How to retweet a tweet in iphone app? | hy i am using twitter api to get feeds/tweets of any user now i want to retweet a tweet so kindly help me that how can i retweet it in a same way as twitter official retweet.
I haven't used MGTwitterEngine yet how to integrate it in my app or tell me some other way. | twitter | null | null | null | null | null | open | How to retweet a tweet in iphone app?
===
hy i am using twitter api to get feeds/tweets of any user now i want to retweet a tweet so kindly help me that how can i retweet it in a same way as twitter official retweet.
I haven't used MGTwitterEngine yet how to integrate it in my app or tell me some other way. | 0 |
4,380,185 | 12/07/2010 18:26:07 | 384,034 | 12/15/2009 22:05:30 | 23 | 1 | Super short and awesome variable name in C# | Probably a bit silly of a porblem, but I have this one variable (a part of a library) that I am using all the time (it gives me access to a whole lot of properties and functions). I want it to be as short as possible, and, preferably, something easy to write. jQuery's "$" would be pretty great, but that doesn't work, neither do any numbers or symbols I tried. I _could_ use something like "s", but I was hoping there'd be something even better (and something that's not just one boring Latin letter).
So what would be SO's best super-short-and-awesome variable name? | c# | variables | null | null | null | 12/07/2010 18:48:18 | not a real question | Super short and awesome variable name in C#
===
Probably a bit silly of a porblem, but I have this one variable (a part of a library) that I am using all the time (it gives me access to a whole lot of properties and functions). I want it to be as short as possible, and, preferably, something easy to write. jQuery's "$" would be pretty great, but that doesn't work, neither do any numbers or symbols I tried. I _could_ use something like "s", but I was hoping there'd be something even better (and something that's not just one boring Latin letter).
So what would be SO's best super-short-and-awesome variable name? | 1 |
10,103,984 | 04/11/2012 10:15:45 | 547,995 | 12/19/2010 21:46:42 | 404 | 3 | Menu with Image in Joomla | Hy!!
I am new to joomla. I have to rebuild [http://www.bern.ch/weiche_de][1] for school.
I want to build the menu like this:
![enter image description here][2]
My actuall Menu looks like:
![enter image description here][3]
Please help!
[1]: http://www.bern.ch/weiche_de
[2]: http://i.stack.imgur.com/wTdlW.png
[3]: http://i.stack.imgur.com/dR3NU.png | joomla | null | null | null | null | 04/12/2012 14:47:14 | not a real question | Menu with Image in Joomla
===
Hy!!
I am new to joomla. I have to rebuild [http://www.bern.ch/weiche_de][1] for school.
I want to build the menu like this:
![enter image description here][2]
My actuall Menu looks like:
![enter image description here][3]
Please help!
[1]: http://www.bern.ch/weiche_de
[2]: http://i.stack.imgur.com/wTdlW.png
[3]: http://i.stack.imgur.com/dR3NU.png | 1 |
6,122,827 | 05/25/2011 10:15:43 | 692,956 | 04/05/2011 13:15:13 | 18 | 0 | Low level capabilities of high level languages | I would like to know some low-level capabilities of high-level languages.
Off the top of my head I could point out:
-bitwise operations
-bit fields
-pointer arithmetic
-inline assembly
-interrupt functions
I would apreciate if you pointed out some, that aren't in my list. It would be nice if C or Pascal had them, but basically any high-level language will do.
Thank you. | c | programming-languages | pascal | low-level | high-level | 05/27/2011 08:23:54 | not a real question | Low level capabilities of high level languages
===
I would like to know some low-level capabilities of high-level languages.
Off the top of my head I could point out:
-bitwise operations
-bit fields
-pointer arithmetic
-inline assembly
-interrupt functions
I would apreciate if you pointed out some, that aren't in my list. It would be nice if C or Pascal had them, but basically any high-level language will do.
Thank you. | 1 |
7,369,561 | 09/10/2011 04:10:39 | 763,053 | 05/20/2011 16:07:45 | 340 | 1 | Can't Connect to MYSQL via PHP | I've tried connecting to mysql via my registered server on dreamhost, and via localhost. Neither one seems to work. I know I'm giving the proper data for user and such, but all I get is a dead connection.
I'm running Ubuntu 11.04... | php | mysql | null | null | null | 09/10/2011 04:56:02 | not a real question | Can't Connect to MYSQL via PHP
===
I've tried connecting to mysql via my registered server on dreamhost, and via localhost. Neither one seems to work. I know I'm giving the proper data for user and such, but all I get is a dead connection.
I'm running Ubuntu 11.04... | 1 |
10,117,107 | 04/12/2012 03:46:12 | 85,714 | 04/01/2009 14:42:34 | 75 | 2 | How to address poor performance of jQuery mobile list when scrolling in Android | I am developing a mobile web application using JQM and I have been experiencing a problem of having difficulty scrolling in JQM list in Android devices. It seem like when the scroll bar is at the top (and the url address text box can be seen in the browser) or at the bottom, it is very difficult to scroll down or up -- you will have to hold your finger and drag it down or up but once it get pass the initial scroll, it is a lot easier to scroll. This actually cause a major problems as in our user experience test, a lot of users are complaining about this.
Perhaps this video will help explain the problem I am facing:
http://jquerymobile.com/demos/1.1.0-rc.1/docs/lists/index.html
I did try out the RC 1.1 and found that the scrolling is better but still the problem with scroll insensitivity at the top/bottom persist.
http://jquerymobile.com/demos/1.1.0-rc.1/docs/lists/index.html
Any thoughts on how to address this, or do we just have to live with it for now? | android | jquery-mobile | null | null | null | 04/14/2012 13:05:17 | not a real question | How to address poor performance of jQuery mobile list when scrolling in Android
===
I am developing a mobile web application using JQM and I have been experiencing a problem of having difficulty scrolling in JQM list in Android devices. It seem like when the scroll bar is at the top (and the url address text box can be seen in the browser) or at the bottom, it is very difficult to scroll down or up -- you will have to hold your finger and drag it down or up but once it get pass the initial scroll, it is a lot easier to scroll. This actually cause a major problems as in our user experience test, a lot of users are complaining about this.
Perhaps this video will help explain the problem I am facing:
http://jquerymobile.com/demos/1.1.0-rc.1/docs/lists/index.html
I did try out the RC 1.1 and found that the scrolling is better but still the problem with scroll insensitivity at the top/bottom persist.
http://jquerymobile.com/demos/1.1.0-rc.1/docs/lists/index.html
Any thoughts on how to address this, or do we just have to live with it for now? | 1 |
4,566,864 | 12/30/2010 22:47:12 | 363,268 | 06/10/2010 09:11:30 | 145 | 1 | Reshaping data into panel format in R | I have a quite long and (for me) complex question. I have voting data from the Council of the European Union, where the voting behavior for each country has been coded according to a nominal scale:
0: yes
1: no
2: Abstention
3: no with a negative statement
4: Abstention with a negative statement
5: yes with a negative statement
The data is in the following format (see the end of the post for a dump of 20 observations from the data set):
Country1 Country2 Country3 ... Date
1 0 0 ... 2004-12-12
1 2 0 ... 2003-02-14
2 0 1 ... 2004-05-22
... ... ... ... ...
First of all I would like to aggregate the data into monthly intervals, where for each month we have a sum of how many 0,1,2 etc there were for each country. Ideally the data should look like this:
Month Country sum of 0s sum of 1s Sum of 2s
January Country1 2 0 1
January Country2 4 0 0
... ... ... ... ...
Once this has been done I would like to put the data into panel format like this:
Country Month sum of 0s sum of 1s sum of 2s
Country1 January 2 0 1
Country1 February 0 1 3
... ... ... ... ...
Country2 January 4 0 0
Country2 February 2 2 0
... ... ... ... ...
I am sorry if this is a very time consuming question, but I have been playing around with aggregate, by and different apply functions forever, without being able to get the desired result. Any help will be greatly appreciated!
best, Thomas
20 observations from the data set (output from the dput() function):
structure(list(Recitals = c(29L, 13L, 2L, 20L, 10L, 18L, 29L,
6L, 4L, 16L, 7L, 6L, 12L, 23L, 6L, 10L, 2L, 6L, 9L, 8L, 7L),
Voting_Rule = structure(c(4L, 4L, 5L, 5L, 5L, 5L, 5L, 4L,
4L, 4L, 5L, 4L, 5L, 4L, 5L, 4L, 4L, 5L, 4L, 4L, 4L), .Label = c("0",
"Qualified Majority", "Simple Majority", "Unanimity", "Qualified majority",
"Simple majority"), class = "factor"), Belgium = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L), Denmark = c(0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
Czech.Republic = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Germany = c(0L,
0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Estonia = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Greece = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Spain = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L), France = c(0L, 0L, 0L, 3L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Ireland = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Italy = c(0L, 0L, 0L, 0L, 0L, 0L, 5L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
Cyprus = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Latvia = c(0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L), Lithuania = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Luxembourg = c(0L,
0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Hungary = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Malta = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Netherlands = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Austria = c(0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Poland = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Portugal = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Slovenia = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Slovakia = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Finland = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Sweden = c(0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
UK = c(0L, 0L, 0L, 0L, 0L, 0L, 5L, 0L, 0L, 0L, 5L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Dates = structure(c(12716,
12716, 12716, 12674, 12674, 12698, 12705, 12724, 12738, 12738,
12716, 12741, 12744, 12754, 12754, 12758, 12758, 12758, 12759,
12759, 12759), class = "Date")), .Names = c("Recitals", "Voting_Rule",
"Belgium", "Denmark", "Czech.Republic", "Germany", "Estonia",
"Greece", "Spain", "France", "Ireland", "Italy", "Cyprus", "Latvia",
"Lithuania", "Luxembourg", "Hungary", "Malta", "Netherlands",
"Austria", "Poland", "Portugal", "Slovenia", "Slovakia", "Finland",
"Sweden", "UK", "Dates"), row.names = c(752L, 753L, 762L, 774L,
775L, 776L, 777L, 780L, 789L, 790L, 793L, 794L, 797L, 816L, 817L,
818L, 819L, 820L, 824L, 825L, 826L), class = "data.frame")
| r | data | panel | aggregate | reshape | null | open | Reshaping data into panel format in R
===
I have a quite long and (for me) complex question. I have voting data from the Council of the European Union, where the voting behavior for each country has been coded according to a nominal scale:
0: yes
1: no
2: Abstention
3: no with a negative statement
4: Abstention with a negative statement
5: yes with a negative statement
The data is in the following format (see the end of the post for a dump of 20 observations from the data set):
Country1 Country2 Country3 ... Date
1 0 0 ... 2004-12-12
1 2 0 ... 2003-02-14
2 0 1 ... 2004-05-22
... ... ... ... ...
First of all I would like to aggregate the data into monthly intervals, where for each month we have a sum of how many 0,1,2 etc there were for each country. Ideally the data should look like this:
Month Country sum of 0s sum of 1s Sum of 2s
January Country1 2 0 1
January Country2 4 0 0
... ... ... ... ...
Once this has been done I would like to put the data into panel format like this:
Country Month sum of 0s sum of 1s sum of 2s
Country1 January 2 0 1
Country1 February 0 1 3
... ... ... ... ...
Country2 January 4 0 0
Country2 February 2 2 0
... ... ... ... ...
I am sorry if this is a very time consuming question, but I have been playing around with aggregate, by and different apply functions forever, without being able to get the desired result. Any help will be greatly appreciated!
best, Thomas
20 observations from the data set (output from the dput() function):
structure(list(Recitals = c(29L, 13L, 2L, 20L, 10L, 18L, 29L,
6L, 4L, 16L, 7L, 6L, 12L, 23L, 6L, 10L, 2L, 6L, 9L, 8L, 7L),
Voting_Rule = structure(c(4L, 4L, 5L, 5L, 5L, 5L, 5L, 4L,
4L, 4L, 5L, 4L, 5L, 4L, 5L, 4L, 4L, 5L, 4L, 4L, 4L), .Label = c("0",
"Qualified Majority", "Simple Majority", "Unanimity", "Qualified majority",
"Simple majority"), class = "factor"), Belgium = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L), Denmark = c(0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
Czech.Republic = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Germany = c(0L,
0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Estonia = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Greece = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Spain = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L), France = c(0L, 0L, 0L, 3L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Ireland = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Italy = c(0L, 0L, 0L, 0L, 0L, 0L, 5L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
Cyprus = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Latvia = c(0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L), Lithuania = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Luxembourg = c(0L,
0L, 0L, 0L, 0L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Hungary = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Malta = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Netherlands = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Austria = c(0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Poland = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Portugal = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Slovenia = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), Slovakia = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Finland = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), Sweden = c(0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L),
UK = c(0L, 0L, 0L, 0L, 0L, 0L, 5L, 0L, 0L, 0L, 5L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), Dates = structure(c(12716,
12716, 12716, 12674, 12674, 12698, 12705, 12724, 12738, 12738,
12716, 12741, 12744, 12754, 12754, 12758, 12758, 12758, 12759,
12759, 12759), class = "Date")), .Names = c("Recitals", "Voting_Rule",
"Belgium", "Denmark", "Czech.Republic", "Germany", "Estonia",
"Greece", "Spain", "France", "Ireland", "Italy", "Cyprus", "Latvia",
"Lithuania", "Luxembourg", "Hungary", "Malta", "Netherlands",
"Austria", "Poland", "Portugal", "Slovenia", "Slovakia", "Finland",
"Sweden", "UK", "Dates"), row.names = c(752L, 753L, 762L, 774L,
775L, 776L, 777L, 780L, 789L, 790L, 793L, 794L, 797L, 816L, 817L,
818L, 819L, 820L, 824L, 825L, 826L), class = "data.frame")
| 0 |
5,845,168 | 04/30/2011 22:54:34 | 650,057 | 03/08/2011 15:34:55 | 1 | 0 | Change colour of text based on a value of another div element, Jquery, html and css? | I want to change the color of a text, based on the value of another div element.
I need this to run every second so setinterval has to go in there some where
something like this:
<div class="abcd">jkl</div>
<div class="xyz">7</div>
if("xyz" <10){
//change "abcd" to "abcd2" which changes its color}
I'm not good at Jquery but I think thats the tool needed for this job.
| javascript | jquery | html | css | null | null | open | Change colour of text based on a value of another div element, Jquery, html and css?
===
I want to change the color of a text, based on the value of another div element.
I need this to run every second so setinterval has to go in there some where
something like this:
<div class="abcd">jkl</div>
<div class="xyz">7</div>
if("xyz" <10){
//change "abcd" to "abcd2" which changes its color}
I'm not good at Jquery but I think thats the tool needed for this job.
| 0 |
11,412,500 | 07/10/2012 11:36:03 | 1,511,579 | 07/09/2012 09:30:59 | 3 | 0 | Call jquery function in Wordpress correctly | i'm developing a website through wordpress source code. I'm using a child theme for twenty ten, and i have a jquery file with a function that i want to incorporate in the website. My problem is: how can i call this file through "functions.php" and not by pasting the script on the html page?
I found i should use something like this:
function my_scripts() {
wp_enqueue_script( 'my-sweet-script', get_bloginfo('template_directory') . '/script.js', array('jquery') );
}
add_action('template_redirect', 'my_scripts');
And where should i put the .js file so that he doesn't get replaced with wordpress updates?
| jquery | wordpress | null | null | null | null | open | Call jquery function in Wordpress correctly
===
i'm developing a website through wordpress source code. I'm using a child theme for twenty ten, and i have a jquery file with a function that i want to incorporate in the website. My problem is: how can i call this file through "functions.php" and not by pasting the script on the html page?
I found i should use something like this:
function my_scripts() {
wp_enqueue_script( 'my-sweet-script', get_bloginfo('template_directory') . '/script.js', array('jquery') );
}
add_action('template_redirect', 'my_scripts');
And where should i put the .js file so that he doesn't get replaced with wordpress updates?
| 0 |
4,671,718 | 01/12/2011 17:12:59 | 386,738 | 07/08/2010 14:13:41 | 476 | 54 | animation with images in cocos2d | I have a sequence of images that can be used as an animation if played one after another.
Which is the most efficient way to accomplish it with cocos2d?
An example would be appreciated!
(I am targeting iPod, iPhone && iPad) | iphone | cocos2d | cocos2d-iphone | null | null | null | open | animation with images in cocos2d
===
I have a sequence of images that can be used as an animation if played one after another.
Which is the most efficient way to accomplish it with cocos2d?
An example would be appreciated!
(I am targeting iPod, iPhone && iPad) | 0 |
6,484,972 | 06/26/2011 15:49:09 | 156,888 | 08/15/2009 10:55:56 | 1,303 | 92 | ViewModel with List<BaseClass> and editor templates | I have a view that lists tables being added to a floor plan. Tables derive from TableInputModel to allow for RectangleTableInputModel, CircleTableInputModel etc
The ViewModel has a list of TableInputModel which are all one of the derived types.
I have a partial view for each of the derived types and given a List of mixed derived types the framework knows how to render them.
However - on submitting the form the type information is lost. I have tried with a custom model binder but because the type info is lost when it's being submitted, it wont work...
has anyone tried this before? | asp.net-mvc | asp.net-mvc-3 | viewmodel | model-binding | null | null | open | ViewModel with List<BaseClass> and editor templates
===
I have a view that lists tables being added to a floor plan. Tables derive from TableInputModel to allow for RectangleTableInputModel, CircleTableInputModel etc
The ViewModel has a list of TableInputModel which are all one of the derived types.
I have a partial view for each of the derived types and given a List of mixed derived types the framework knows how to render them.
However - on submitting the form the type information is lost. I have tried with a custom model binder but because the type info is lost when it's being submitted, it wont work...
has anyone tried this before? | 0 |
7,658,226 | 10/05/2011 07:48:26 | 754,357 | 05/15/2011 09:50:52 | 1 | 0 | Start a subordinate process | I would like to start a process from my application with Process.Start() and I would like that in case of my app crash or the user close it then the child process is automatically killed.
Is it possible to obtain something like this? | c# | multiprocess | null | null | null | null | open | Start a subordinate process
===
I would like to start a process from my application with Process.Start() and I would like that in case of my app crash or the user close it then the child process is automatically killed.
Is it possible to obtain something like this? | 0 |
1,657,611 | 11/01/2009 16:36:04 | 13,442 | 09/16/2008 19:07:50 | 1,351 | 117 | Link to actions that dont use https from a page that uses https | I use RequireSsl attribute to redirect to a https url if an action is decorated with it.
[RequireSsl ][1]
I now need a good way to link back to url that dont use https. This post explains my problem in clear english: [link to http][2]
I am not shure what the easiest way is. In old school ASP.NET I used [secureWebPages on codeproject][3]. To be honest I dont know exactly what this httpModule does: It just worked.
I guess it does a 302 redirect to a http url if a page is requested via https that only requires http. My first idea is to have an action filter like RequireSll but with a rule that redirects to http if "Request.IsSecure". It only gets a bit awkward at the end. Almost all of my url dont require https, thats why I would have to decorate nearly all of the controllers with a "NoSsl" attribute.
How do you handle this situation?
[1]: http://stackoverflow.com/questions/1654320/requiressl-fails-on-url-with-querystring
[2]: http://stackoverflow.com/questions/584251/short-way-to-link-to-http-from-https-and-vice-versa-using-relative-links
[3]: http://www.codeproject.com/KB/aspnet/WebPageSecurity.aspx?msg=784028 | asp.net-mvc | ssl | https | null | null | null | open | Link to actions that dont use https from a page that uses https
===
I use RequireSsl attribute to redirect to a https url if an action is decorated with it.
[RequireSsl ][1]
I now need a good way to link back to url that dont use https. This post explains my problem in clear english: [link to http][2]
I am not shure what the easiest way is. In old school ASP.NET I used [secureWebPages on codeproject][3]. To be honest I dont know exactly what this httpModule does: It just worked.
I guess it does a 302 redirect to a http url if a page is requested via https that only requires http. My first idea is to have an action filter like RequireSll but with a rule that redirects to http if "Request.IsSecure". It only gets a bit awkward at the end. Almost all of my url dont require https, thats why I would have to decorate nearly all of the controllers with a "NoSsl" attribute.
How do you handle this situation?
[1]: http://stackoverflow.com/questions/1654320/requiressl-fails-on-url-with-querystring
[2]: http://stackoverflow.com/questions/584251/short-way-to-link-to-http-from-https-and-vice-versa-using-relative-links
[3]: http://www.codeproject.com/KB/aspnet/WebPageSecurity.aspx?msg=784028 | 0 |
5,566,670 | 04/06/2011 12:53:48 | 775,132 | 08/08/2010 18:02:18 | 32 | 3 | django iis6 with pyisapie and sqlite3 on production server | I am using django on windows 2003 Server SP2 and iis6 with pyisapi.
Now the question is:
Do you recommend using sqlite3 on this production server?
Could you please also mention the advantages and disadvantages of using sqlite3 for usage on a deployment server in general and especially for windows 2003 Server.
Our Application is an order management tool, which needs 5 client accesses (not necessarily concurrent). It is only used in the intranet. For this purpose we have adjusted the admin interface for our purpose.
Thank you in advance !! | django | deployment | iis6 | sqlite3 | pyisapie | null | open | django iis6 with pyisapie and sqlite3 on production server
===
I am using django on windows 2003 Server SP2 and iis6 with pyisapi.
Now the question is:
Do you recommend using sqlite3 on this production server?
Could you please also mention the advantages and disadvantages of using sqlite3 for usage on a deployment server in general and especially for windows 2003 Server.
Our Application is an order management tool, which needs 5 client accesses (not necessarily concurrent). It is only used in the intranet. For this purpose we have adjusted the admin interface for our purpose.
Thank you in advance !! | 0 |
2,983,986 | 06/06/2010 11:22:02 | 224,998 | 12/04/2009 18:41:22 | 93 | 3 | custom usercontrol - Bring a form to the front | How to Bring (form_x) to the front.
I have a custom usercontrol which opens (form_x) and I use this usercontrol for all of my forms. and now the problem is that the usercontrol opens a new (form_x) instead of Bringing of(form_x) to the front. | .net | null | null | null | null | null | open | custom usercontrol - Bring a form to the front
===
How to Bring (form_x) to the front.
I have a custom usercontrol which opens (form_x) and I use this usercontrol for all of my forms. and now the problem is that the usercontrol opens a new (form_x) instead of Bringing of(form_x) to the front. | 0 |
11,586,730 | 07/20/2012 20:46:45 | 1,539,378 | 07/19/2012 23:42:52 | 1 | 0 | Constructing a predictive algorithm (NN?) with various amounts of features for each training point in R | I am relatively new to machine learning but have been trying to train an algorithm to predict if an account will close or not using thousands of data points and many features (I will post an example of data below). I am using data from the month before the account closed but the problem is that accounts have been around for different amounts of time. So, whereas for one account I might only have performance data up to 1 year, for another account I might have 1 month, 3 month, 1 year, 3 year, 5 year and even 10 year. I am looking for some help on how I can build an algorithm that incorporates the different amounts of data for each account. I was thinking about using a neural net because I have always been interested in them but I am open to any suggestions. I can really just use help in any way on this problem. There were 94 features but I cut it down to 19 to start playing around with it. I will gladly accept any advice on how to approach this problem.
[1]: http://i.stack.imgur.com/y1VVj.jpg | performance | r | machine-learning | classification | finance | 07/21/2012 05:57:13 | off topic | Constructing a predictive algorithm (NN?) with various amounts of features for each training point in R
===
I am relatively new to machine learning but have been trying to train an algorithm to predict if an account will close or not using thousands of data points and many features (I will post an example of data below). I am using data from the month before the account closed but the problem is that accounts have been around for different amounts of time. So, whereas for one account I might only have performance data up to 1 year, for another account I might have 1 month, 3 month, 1 year, 3 year, 5 year and even 10 year. I am looking for some help on how I can build an algorithm that incorporates the different amounts of data for each account. I was thinking about using a neural net because I have always been interested in them but I am open to any suggestions. I can really just use help in any way on this problem. There were 94 features but I cut it down to 19 to start playing around with it. I will gladly accept any advice on how to approach this problem.
[1]: http://i.stack.imgur.com/y1VVj.jpg | 2 |
10,308,563 | 04/25/2012 02:24:07 | 1,299,659 | 03/29/2012 02:18:40 | 3 | 0 | The best database for low volume banking software -PHP | I am building an application that maintains an available cash balance for services purchased, funded by credit card or money order. Naturally, as a small startup, performance isn't much of an issue, since the volume won't be there in the beginning.
That said, my budget is tiny READ: open source for now. I would be a fool to use the traditional Z mainframe; oracle for that matter, so I am debating between innodb or myisam engine for mysql.
For most of my projects, I choose innodb. Could such be a viable option, for, say the first hypothetical 100K customers? Or myisam? Is table locking recommended for financial transactions? | php | mysql | null | null | null | 04/25/2012 02:43:51 | not constructive | The best database for low volume banking software -PHP
===
I am building an application that maintains an available cash balance for services purchased, funded by credit card or money order. Naturally, as a small startup, performance isn't much of an issue, since the volume won't be there in the beginning.
That said, my budget is tiny READ: open source for now. I would be a fool to use the traditional Z mainframe; oracle for that matter, so I am debating between innodb or myisam engine for mysql.
For most of my projects, I choose innodb. Could such be a viable option, for, say the first hypothetical 100K customers? Or myisam? Is table locking recommended for financial transactions? | 4 |
3,282,184 | 07/19/2010 14:54:07 | 364,645 | 06/11/2010 14:45:07 | 6 | 0 | I'm buying a Point of Sale software, is it possible to get full source code and for how much? | A little company is developping a software for my business. I would like to know if it would be possible that I ask them to get the full source code. (I want to be independent)
Do you think it would be possible?
Do you think they will charge me an extra amount for that ? (probably)
Thanks, | source | null | null | null | null | 07/19/2010 15:02:34 | off topic | I'm buying a Point of Sale software, is it possible to get full source code and for how much?
===
A little company is developping a software for my business. I would like to know if it would be possible that I ask them to get the full source code. (I want to be independent)
Do you think it would be possible?
Do you think they will charge me an extra amount for that ? (probably)
Thanks, | 2 |
6,159,955 | 05/28/2011 06:01:02 | 34,537 | 11/05/2008 03:00:23 | 9,139 | 155 | C++ Templates: Byval/Reference interfering with eachother | Here's a simplified version of my problem. I have a property class. It has data like has_initalized and such which i removed for this example.
When i call a function which uses T its fine. However T& isnt so i decided to write a T& version of it. But this causes all functions which uses plain T to get a compile error. Why is T& interfering with that? For this example how do i get both functions (Q and W) to work without changing main()?
template <class T>
class Property {
T v;
Property(Property&p) { }
public:
Property() {}
T operator=(T src) { v = src; return v; }
operator T() const { return v; }
operator T&() const{ return v; }
T operator->() { return v; }
};
class A{};
void Q(A s){}
void W(A& s){}
int main(){
Property<A> a;
Q(a);
W(a);
}
| c++ | templates | null | null | null | null | open | C++ Templates: Byval/Reference interfering with eachother
===
Here's a simplified version of my problem. I have a property class. It has data like has_initalized and such which i removed for this example.
When i call a function which uses T its fine. However T& isnt so i decided to write a T& version of it. But this causes all functions which uses plain T to get a compile error. Why is T& interfering with that? For this example how do i get both functions (Q and W) to work without changing main()?
template <class T>
class Property {
T v;
Property(Property&p) { }
public:
Property() {}
T operator=(T src) { v = src; return v; }
operator T() const { return v; }
operator T&() const{ return v; }
T operator->() { return v; }
};
class A{};
void Q(A s){}
void W(A& s){}
int main(){
Property<A> a;
Q(a);
W(a);
}
| 0 |
5,766,663 | 04/23/2011 20:17:13 | 111,665 | 05/05/2009 19:48:19 | 2,018 | 41 | Do you still Hide from browsers that do not support JavaScript? | Some of the examples I'm reading start with:
<script language="javascript" type="text/javascript">
<!-- Hide from browsers that do not support JavaScript
// --> Finish hiding
</script>
1. Do you still wrap your js code in html comments?
2. Do you still include language="javascript"?
3. Do you still include type="text/javascript"?
| javascript | null | null | null | null | 04/25/2011 17:58:28 | off topic | Do you still Hide from browsers that do not support JavaScript?
===
Some of the examples I'm reading start with:
<script language="javascript" type="text/javascript">
<!-- Hide from browsers that do not support JavaScript
// --> Finish hiding
</script>
1. Do you still wrap your js code in html comments?
2. Do you still include language="javascript"?
3. Do you still include type="text/javascript"?
| 2 |
10,894,790 | 06/05/2012 09:28:27 | 1,369,739 | 05/02/2012 10:11:53 | 109 | 5 | Symfony2 and Assetics : symlink on Windows 7? | I'm having a hard time using assetics to load resources in my views (I work with Symfony2).
I was working on Linux (Ubuntu 10.4) and switched to Windows 7 a few days ago. I've always been having trouble (some images didn't load for example), but at least most images, and all styles and scripts were loading alright.
When I switched to Windows, some resources weren't loading, so I tried a `php app/console assets:install web --symlink`
I was quite surprised to see that it had deleted the whole public folder of the bundle I was working on. And there was no way to find the sources again (fortunately, I had saved some of them, and I was able to retrieve most of my work thanks to cached files).
After I've recovered my files (and backed them up), I tried to command again. Same result. I tried without the `--symlink` and it created some folders in the `web/bundle` folder, instead of files that were there before (supposedly, the symlinks).
Now the command doesn't even answer anymore (it has been erasing my sources even in some of my backup folders!!).
Bottom-line : is there a way to configure assetics on Windows 7 so that it doesn't eat my files and loads the resources (including images in css) correctly?
Thanks in advance!
| windows-7 | symfony-2.0 | symlink | assets | null | null | open | Symfony2 and Assetics : symlink on Windows 7?
===
I'm having a hard time using assetics to load resources in my views (I work with Symfony2).
I was working on Linux (Ubuntu 10.4) and switched to Windows 7 a few days ago. I've always been having trouble (some images didn't load for example), but at least most images, and all styles and scripts were loading alright.
When I switched to Windows, some resources weren't loading, so I tried a `php app/console assets:install web --symlink`
I was quite surprised to see that it had deleted the whole public folder of the bundle I was working on. And there was no way to find the sources again (fortunately, I had saved some of them, and I was able to retrieve most of my work thanks to cached files).
After I've recovered my files (and backed them up), I tried to command again. Same result. I tried without the `--symlink` and it created some folders in the `web/bundle` folder, instead of files that were there before (supposedly, the symlinks).
Now the command doesn't even answer anymore (it has been erasing my sources even in some of my backup folders!!).
Bottom-line : is there a way to configure assetics on Windows 7 so that it doesn't eat my files and loads the resources (including images in css) correctly?
Thanks in advance!
| 0 |
4,293,459 | 11/27/2010 19:26:30 | 98,215 | 04/30/2009 03:15:21 | 1,710 | 27 | Where should data validation occur? | I have a method 'ABC' that does some stuff. The ABC method is called from another method, method XYZ. Where should the data validation of the input values occur?
Should I validate in XYZ before even calling ABC? If it's bad data method ABC won't even be called.
Or, should I validate in ABC?
Or, validate in both locations?
| validation | design-patterns | null | null | null | null | open | Where should data validation occur?
===
I have a method 'ABC' that does some stuff. The ABC method is called from another method, method XYZ. Where should the data validation of the input values occur?
Should I validate in XYZ before even calling ABC? If it's bad data method ABC won't even be called.
Or, should I validate in ABC?
Or, validate in both locations?
| 0 |
2,358,656 | 03/01/2010 20:00:19 | 183,929 | 10/04/2009 13:34:11 | 1,024 | 74 | Examples of well written simple PyGTK apps? | I'm looking to get my hands dirty with PyGTK and was wondering if anyone can recommend any relatively simple, really cleanly written PyGTK apps that I can look to for best practices or examples? Any type of app will do, as long as it's simple-ish (i.e., please don't recommend a huge app) and generally considered to be well written.
The [list of PyGTK apps][1] is huge and really nice but I have no idea which of those apps are good examples and which should be more used as examples of what not to do.
[1]: http://www.pygtk.org/applications.html | pygtk | python | gtk | null | null | null | open | Examples of well written simple PyGTK apps?
===
I'm looking to get my hands dirty with PyGTK and was wondering if anyone can recommend any relatively simple, really cleanly written PyGTK apps that I can look to for best practices or examples? Any type of app will do, as long as it's simple-ish (i.e., please don't recommend a huge app) and generally considered to be well written.
The [list of PyGTK apps][1] is huge and really nice but I have no idea which of those apps are good examples and which should be more used as examples of what not to do.
[1]: http://www.pygtk.org/applications.html | 0 |
8,258,775 | 11/24/2011 14:39:26 | 265,968 | 02/04/2010 07:34:51 | 1 | 2 | Convert parts of mySQL DB from website into CoreData/SQLite on iOS | I have a website with mySQL database, parts of which I'd like to reuse in my iPhone app by populating CoreData DB (basically iPhone app is going to be an offline version of the website).
I am thinking of writing scripts which will translate mySQL into SQLite and then somehow feed the data into CoreData.
How would you accomplish this task? | iphone | mysql | core-data | null | null | null | open | Convert parts of mySQL DB from website into CoreData/SQLite on iOS
===
I have a website with mySQL database, parts of which I'd like to reuse in my iPhone app by populating CoreData DB (basically iPhone app is going to be an offline version of the website).
I am thinking of writing scripts which will translate mySQL into SQLite and then somehow feed the data into CoreData.
How would you accomplish this task? | 0 |
4,134,314 | 11/09/2010 13:46:52 | 501,952 | 11/09/2010 13:46:52 | 1 | 0 | Live plot from stdin | I have an application which prints numbers to stdout. Is there an easy way of using any commandline plot tool (gnuplot) for a live plot of the image? | live | plot | null | null | null | null | open | Live plot from stdin
===
I have an application which prints numbers to stdout. Is there an easy way of using any commandline plot tool (gnuplot) for a live plot of the image? | 0 |
5,582,264 | 04/07/2011 13:55:14 | 304,319 | 03/29/2010 14:45:53 | 1,296 | 100 | Python how to reduce on a list of tuple? | Hi I am able to use map and sum to achieve this functionality, but how to use reduce?
There are 2 lists: a, b, they have same number of values. I want to calculate a[0]*b[0]+a[1]*b[1]+...+a[n]*b[n]
The working version I wrote using map is
value = sum(map(lambda (x,y): x*y, zip(a, b)))
How to use reduce then? I wrote:
value = reduce(lambda (x,y): x[0]*y[0] + x[1]*y[1], zip(a, b)))
I got the error "TypeError: 'float' object is unsubscriptable".
Can anyone shed some light on this? Thanks in advance! | python | map | sum | reduce | null | null | open | Python how to reduce on a list of tuple?
===
Hi I am able to use map and sum to achieve this functionality, but how to use reduce?
There are 2 lists: a, b, they have same number of values. I want to calculate a[0]*b[0]+a[1]*b[1]+...+a[n]*b[n]
The working version I wrote using map is
value = sum(map(lambda (x,y): x*y, zip(a, b)))
How to use reduce then? I wrote:
value = reduce(lambda (x,y): x[0]*y[0] + x[1]*y[1], zip(a, b)))
I got the error "TypeError: 'float' object is unsubscriptable".
Can anyone shed some light on this? Thanks in advance! | 0 |
8,049,132 | 11/08/2011 10:39:16 | 231,644 | 12/14/2009 21:30:45 | 92 | 4 | How can I detect whether a symlink is broken in Bash? | I run `find` and iterate through the results with `[ \( -L $F \) ]` to collect certain symbolic links.
I am wondering if there is an easy way to determine if the link is broken in this scenario.
Here is my code:
FILES=`find /target/ | grep -v '\.disabled$' | sort`
for F in $FILES; do
if [ -L $F ]; then
DO THINGS
fi
done | bash | symlink | null | null | null | null | open | How can I detect whether a symlink is broken in Bash?
===
I run `find` and iterate through the results with `[ \( -L $F \) ]` to collect certain symbolic links.
I am wondering if there is an easy way to determine if the link is broken in this scenario.
Here is my code:
FILES=`find /target/ | grep -v '\.disabled$' | sort`
for F in $FILES; do
if [ -L $F ]; then
DO THINGS
fi
done | 0 |
9,971,008 | 04/02/2012 04:45:57 | 275,414 | 02/17/2010 16:44:35 | 210 | 10 | What to learn to make iOS and Android apps | Ok, so I want to kinda hit two birds with one stone. I have made apps in the past but mainly javascript that runs through phonegap or something like that, is thre one coding language to learn to code in both platforms.
Thanks | android | iphone | ios | null | null | 04/02/2012 06:00:16 | not constructive | What to learn to make iOS and Android apps
===
Ok, so I want to kinda hit two birds with one stone. I have made apps in the past but mainly javascript that runs through phonegap or something like that, is thre one coding language to learn to code in both platforms.
Thanks | 4 |
5,848,186 | 05/01/2011 11:56:03 | 548,943 | 09/14/2009 17:18:55 | 1 | 0 | regex to replace 0 in list but not 0 of 10, 20, 30, etc. - using js replace | trying to create a regex to replace zeros in list with an empty value but not replace the zeros in ten, twenty, thirty, etc.
list = 0,1,0,20,0,0,1,,1,3,10,30,0
desired list = ,1,,20,,,1,,1,3,10,30,
Using this in the javascript replace function
Any help/tips appreciated! | javascript | regex | list | replace | numbers | null | open | regex to replace 0 in list but not 0 of 10, 20, 30, etc. - using js replace
===
trying to create a regex to replace zeros in list with an empty value but not replace the zeros in ten, twenty, thirty, etc.
list = 0,1,0,20,0,0,1,,1,3,10,30,0
desired list = ,1,,20,,,1,,1,3,10,30,
Using this in the javascript replace function
Any help/tips appreciated! | 0 |
11,677,354 | 07/26/2012 20:17:29 | 339,428 | 05/12/2010 14:48:05 | 2,480 | 117 | jQuery: hide/show don't respect maxHeight/maxWidth options | I have a dialog, and within that dialog are some checkboxes. When the checkboxes are selected, they expand showing more content using show(). I have the dialog's height option set to 'auto' and maxHeight set to 900. Problem is, when you click on the check boxes, the dialog grows larger than it's max height.
$("#some-id").dialog({
height: 'auto',
maxHeight: 900
});
I cannot set height to an explicit value because I don't know how big it is going to be initially.
Why is it that hide()/show() violate the maxHeight and how can I fix it? | jquery | jquery-ui | jquery-ui-dialog | null | null | null | open | jQuery: hide/show don't respect maxHeight/maxWidth options
===
I have a dialog, and within that dialog are some checkboxes. When the checkboxes are selected, they expand showing more content using show(). I have the dialog's height option set to 'auto' and maxHeight set to 900. Problem is, when you click on the check boxes, the dialog grows larger than it's max height.
$("#some-id").dialog({
height: 'auto',
maxHeight: 900
});
I cannot set height to an explicit value because I don't know how big it is going to be initially.
Why is it that hide()/show() violate the maxHeight and how can I fix it? | 0 |
7,183,807 | 08/25/2011 00:17:25 | 104,361 | 05/10/2009 13:15:24 | 615 | 21 | Ranking algorithm based on Upvotes and Views, without downvotes | I'm building an app where videos can be 'Liked' (upvoted), and we're tracking unique views, but there is *no downvoting*.
[This article][1]
seems to outline the standard for ranking videos that can be both upvoted and downvoted, preventing early submissions from dominating based on their seniority. However, the math is a bit too advanced for me to understand whether or not equating views (which might count as 'apathy votes') with downvotes for this purpose will still breed useful results. This will still reflect the ratio of upvotes, but may well punish a video for being popular in terms of views without garnering a bunch of likes too.
Do you expect that I could use this algorithm, equating views with downvotes?
If not, how might I go about ranking based on the ratio and quantity of views and upvotes?
Thanks.
[1]: http://www.evanmiller.org/how-not-to-sort-by-average-rating.html | algorithm | ranking | null | null | null | 08/25/2011 01:45:41 | off topic | Ranking algorithm based on Upvotes and Views, without downvotes
===
I'm building an app where videos can be 'Liked' (upvoted), and we're tracking unique views, but there is *no downvoting*.
[This article][1]
seems to outline the standard for ranking videos that can be both upvoted and downvoted, preventing early submissions from dominating based on their seniority. However, the math is a bit too advanced for me to understand whether or not equating views (which might count as 'apathy votes') with downvotes for this purpose will still breed useful results. This will still reflect the ratio of upvotes, but may well punish a video for being popular in terms of views without garnering a bunch of likes too.
Do you expect that I could use this algorithm, equating views with downvotes?
If not, how might I go about ranking based on the ratio and quantity of views and upvotes?
Thanks.
[1]: http://www.evanmiller.org/how-not-to-sort-by-average-rating.html | 2 |
8,985,659 | 01/24/2012 10:59:15 | 358,232 | 06/04/2010 08:18:56 | 22 | 0 | Difference between smart pointer and auto pointer | I am new to c++.
Please explain me what is the difference between smart pointer and auto pointer with examples. | c++ | null | null | null | null | 01/24/2012 11:04:42 | not a real question | Difference between smart pointer and auto pointer
===
I am new to c++.
Please explain me what is the difference between smart pointer and auto pointer with examples. | 1 |
2,029,428 | 01/08/2010 17:35:41 | 133,466 | 07/05/2009 23:02:59 | 418 | 1 | Dictionary Matching / Spell Check Program | Please help me with a spellcheck program in C. The majority of the coding are complete (I think...). I'm really stuck because I'm not sure why the program wouldn't compile. Admittedly, I'm still an amateur coder, would you also provide a few suggestions on some of the bad coding habits that I have in the code? Thank you!
What's required...
There is only one stage on this project, writing the spellCheck routine. The spellCheck function has two parameters. The first parameter (article[]) is a pointer to an array of characters. The contents of this array are an article that you need to spell check. The end of the article is marked with the normal 0 (marking the end of a string). The article includes punctuation, upper and lower case words, numbers, and abbreviations. Your function must print every word in the article that cannot be found in the dictionary. The dictionary is the second parameter to the function (more on this later).
#include <stdio.h>
#include<string.h>
char dictionary[1000000];
char article[100000];
void spellCheck(char[], char[]);
int main(void) {
FILE* dict_file;
FILE* article_file;
int bytes_read;
char* p;
dict_file = fopen("american-english.txt", "r");
if (dict_file == 0) {
printf("unable to open dictionary file \"american-english.txt\"\n");
return -1;
}
article_file = fopen("article.txt", "r");
if (article_file == 0) {
printf("unable to open file \"article.txt\"\n");
return -1;
}
/* read dictionary */
p = dictionary;
p = fgets(p, 100, dict_file);
while (p != 0) {
while (*p != '\0') {
p += 1;
}
p = fgets(p, 100, dict_file);
}
/* read article */
p = article;
bytes_read = fread(p, 1, 1000, article_file);
p += bytes_read;
while (bytes_read != 0) {
bytes_read = fread(p, 1, 1000, article_file);
p += bytes_read;
}
*p = 0;
spellCheck(article, dictionary);
}
int articlePosition =0;
int dictionaryPosition = 0;
int isLetter(char c);
void removePunc(char article[]);
void toLower( char article[]);
void lowerDictionary( char dictionary[]);
int artLength( char article[]);
void nextArticleWord(char article[], char articleWord[], int artLength, char dictionary[]);
void spellCheck(char article[], char dictionary[]) {
char articleWord[50];
char dictionaryWord[50];
int articleLength = artLength(article);
removePunc(article);
toLower(article);
lowerDictionary(dictionary);
nextArticleWord(article, articleWord, articleLength, dictionary);
}
void nextDictionaryWord(char dictionary[], char dictionaryWord[]){
int i;
for(i =0; dictionary[dictionaryPosition] != '\n'; i++){
dictionaryWord[i] = dictionary[dictionaryPosition];
dictionaryPosition++;
}
}
int isLetter(char c){
if ( (c>='a'&&c<='z') || (c>='A'&&c<='Z'))
return 1;
return 0;
}
void removePunc(char article[]){
int i, j=0;
for ( i =0; article[i] != 0; i++){
if (isLetter(article[i])){
article[j] = article[i];
j++;
}
else if (!isLetter(article[i])){
article[j] = ' ';
j++;
}
}
}
void toLower( char article[]){
int i=0;
for( i; article[i] != 0; i++){
if ( article[i] >= 'A' && article[i] <='Z')
article[i] = article[i] + 32;
}
}
void lowerDictionary( char dictionary[]){
int i=0;
for(i; dictionary[i] != 0; i++){
if (dictionary[i] >= 'A' && dictionary[i] <= 'Z'){
dictionary[i] = dictionary[i] + 32;
}
}
}
int articleLength( char article[] ){
int count=0;
while (article[count] != 0)
count++;
return count;
}
void nextArticleWord(char article[], char articleWord[], int articleLength, char dictionaryWord[], char dictionary[]){
int j, i;
check:
while(!isLetter(article[articlePosition])){
if (article[articlePosition] == 0){
return;
}
articlePosition++;
}
for(j=0; article[articlePosition] != ' ' || articlePosition == articleLength; j++){
articleWord[j] = article[articlePosition];
articlePosition++;
}
if (strlen(articleWord)<2){
goto check;
}
articleWord[j+1] = 0;
//dictionary search
while (!strncmp(articleWord, dictionaryWord,strlen(articleWord))){
nextDictionaryWord(dictionary, dictionaryWord);
}
if(strncmp(articleWord, dictionaryWord,strlen(articleWord)))
return;
printf(articleWord);
}
| c | homework | null | null | null | null | open | Dictionary Matching / Spell Check Program
===
Please help me with a spellcheck program in C. The majority of the coding are complete (I think...). I'm really stuck because I'm not sure why the program wouldn't compile. Admittedly, I'm still an amateur coder, would you also provide a few suggestions on some of the bad coding habits that I have in the code? Thank you!
What's required...
There is only one stage on this project, writing the spellCheck routine. The spellCheck function has two parameters. The first parameter (article[]) is a pointer to an array of characters. The contents of this array are an article that you need to spell check. The end of the article is marked with the normal 0 (marking the end of a string). The article includes punctuation, upper and lower case words, numbers, and abbreviations. Your function must print every word in the article that cannot be found in the dictionary. The dictionary is the second parameter to the function (more on this later).
#include <stdio.h>
#include<string.h>
char dictionary[1000000];
char article[100000];
void spellCheck(char[], char[]);
int main(void) {
FILE* dict_file;
FILE* article_file;
int bytes_read;
char* p;
dict_file = fopen("american-english.txt", "r");
if (dict_file == 0) {
printf("unable to open dictionary file \"american-english.txt\"\n");
return -1;
}
article_file = fopen("article.txt", "r");
if (article_file == 0) {
printf("unable to open file \"article.txt\"\n");
return -1;
}
/* read dictionary */
p = dictionary;
p = fgets(p, 100, dict_file);
while (p != 0) {
while (*p != '\0') {
p += 1;
}
p = fgets(p, 100, dict_file);
}
/* read article */
p = article;
bytes_read = fread(p, 1, 1000, article_file);
p += bytes_read;
while (bytes_read != 0) {
bytes_read = fread(p, 1, 1000, article_file);
p += bytes_read;
}
*p = 0;
spellCheck(article, dictionary);
}
int articlePosition =0;
int dictionaryPosition = 0;
int isLetter(char c);
void removePunc(char article[]);
void toLower( char article[]);
void lowerDictionary( char dictionary[]);
int artLength( char article[]);
void nextArticleWord(char article[], char articleWord[], int artLength, char dictionary[]);
void spellCheck(char article[], char dictionary[]) {
char articleWord[50];
char dictionaryWord[50];
int articleLength = artLength(article);
removePunc(article);
toLower(article);
lowerDictionary(dictionary);
nextArticleWord(article, articleWord, articleLength, dictionary);
}
void nextDictionaryWord(char dictionary[], char dictionaryWord[]){
int i;
for(i =0; dictionary[dictionaryPosition] != '\n'; i++){
dictionaryWord[i] = dictionary[dictionaryPosition];
dictionaryPosition++;
}
}
int isLetter(char c){
if ( (c>='a'&&c<='z') || (c>='A'&&c<='Z'))
return 1;
return 0;
}
void removePunc(char article[]){
int i, j=0;
for ( i =0; article[i] != 0; i++){
if (isLetter(article[i])){
article[j] = article[i];
j++;
}
else if (!isLetter(article[i])){
article[j] = ' ';
j++;
}
}
}
void toLower( char article[]){
int i=0;
for( i; article[i] != 0; i++){
if ( article[i] >= 'A' && article[i] <='Z')
article[i] = article[i] + 32;
}
}
void lowerDictionary( char dictionary[]){
int i=0;
for(i; dictionary[i] != 0; i++){
if (dictionary[i] >= 'A' && dictionary[i] <= 'Z'){
dictionary[i] = dictionary[i] + 32;
}
}
}
int articleLength( char article[] ){
int count=0;
while (article[count] != 0)
count++;
return count;
}
void nextArticleWord(char article[], char articleWord[], int articleLength, char dictionaryWord[], char dictionary[]){
int j, i;
check:
while(!isLetter(article[articlePosition])){
if (article[articlePosition] == 0){
return;
}
articlePosition++;
}
for(j=0; article[articlePosition] != ' ' || articlePosition == articleLength; j++){
articleWord[j] = article[articlePosition];
articlePosition++;
}
if (strlen(articleWord)<2){
goto check;
}
articleWord[j+1] = 0;
//dictionary search
while (!strncmp(articleWord, dictionaryWord,strlen(articleWord))){
nextDictionaryWord(dictionary, dictionaryWord);
}
if(strncmp(articleWord, dictionaryWord,strlen(articleWord)))
return;
printf(articleWord);
}
| 0 |
8,341,845 | 12/01/2011 13:03:41 | 730,805 | 04/29/2011 09:50:03 | 67 | 1 | UPnP: Getting computer to broadcast it's services | I'm starting to work on some UPnP and I have ran into a problem and dont seem to be able to solve. I have installed developer tools for sniffing UPnP messages and devices. My computer sees and can use these services but it doesnt broadcast it's own into WLAN, so I cannot use the MediaServer or MediaRenderer other than locally. I am using Win7 and I have tried turning off my firewall and but no results so far. Any help is appreciated. | windows | upnp | wlan | dlna | null | 12/01/2011 20:45:38 | off topic | UPnP: Getting computer to broadcast it's services
===
I'm starting to work on some UPnP and I have ran into a problem and dont seem to be able to solve. I have installed developer tools for sniffing UPnP messages and devices. My computer sees and can use these services but it doesnt broadcast it's own into WLAN, so I cannot use the MediaServer or MediaRenderer other than locally. I am using Win7 and I have tried turning off my firewall and but no results so far. Any help is appreciated. | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.