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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
126,458 | 09/24/2008 10:50:27 | 15,152 | 09/17/2008 06:37:57 | 203 | 24 | Looking for a bug tracking/task management tool... | Im looking for a free/open source bug tracking tool that doesn't require a database. Any Recommendations? Thanks in advance.
RWendi | project-management | bug-tracking | null | null | null | 09/30/2008 20:42:22 | off topic | Looking for a bug tracking/task management tool...
===
Im looking for a free/open source bug tracking tool that doesn't require a database. Any Recommendations? Thanks in advance.
RWendi | 2 |
5,793,892 | 04/26/2011 17:10:23 | 725,808 | 04/26/2011 17:10:23 | 1 | 0 | Android crashes after running onActivityResult | Hi I'm trying to make a program that will change a picture from class A by picking pictures an grid view image gallery. My grid view class is the same one found on the android main site. I'm changing the imageView buttons by just changing the image resource by using the setImageResource() method.
Now all of my code runs just fine up to the point in the onActivityResult() where the image's resource is being changed, then my program would just crash. I'm not sure what is making my program crash. I know that my code should change the image without problem and that it's reading in the right images to change the original ImageView Button with. Oh and I'm initializing the ImaveView outside of everything so that I can use it in both the onCreate and onActivityResult. Otherwise it wil be outside of the scope of one of those methods. Can someone help me?
This is the code that I'm using.
public class A extends Activity{
private final int Change_Image = 7;
private int Replace_Image = 7;
ImageView spriteImg = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.objecteditscreen);
spriteImg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setClass(getApplicationContext(), com.mobilegamelab.ImagesGridView.class);
startActivityForResult(intent, Change_Image);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch(requestCode)
{
case Change_Image:
if(resultCode== RESULT_OK)
{
int result = data.getIntExtra("newPicture", 0);
Replace_Image = result;
if (Replace_Image == 0)
{
spriteImg.setImageResource(R.drawable.sample_2);
}
else if (Replace_Image == 1)
{
spriteImg.setImageResource(R.drawable.sample_3);
}
else if (Replace_Image == 2)
{
spriteImg.setImageResource(R.drawable.sample_4);
}
else if (Replace_Image == 3)
{
spriteImg.setImageResource(R.drawable.sample_5);
}
else if (Replace_Image == 4)
{
spriteImg.setImageResource(R.drawable.sample_6);
}
else if (Replace_Image == 5)
{
spriteImg.setImageResource(R.drawable.sample_7);
}
else if (Replace_Image == 6)
{
spriteImg.setImageResource(R.drawable.sample8);
}
}
break;
}
}
This is my gridview class
public class ImagesGridView extends Activity {
/** Called when the activity is first created. */
Intent sentIntent;
static int picLocation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gridview);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
sentIntent = getIntent();
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
picLocation = position;
Intent response = new Intent();
response.putExtra("newPicture", picLocation);
setResult(RESULT_OK, response);
finish();
}
});
}
}
| java | android | null | null | null | null | open | Android crashes after running onActivityResult
===
Hi I'm trying to make a program that will change a picture from class A by picking pictures an grid view image gallery. My grid view class is the same one found on the android main site. I'm changing the imageView buttons by just changing the image resource by using the setImageResource() method.
Now all of my code runs just fine up to the point in the onActivityResult() where the image's resource is being changed, then my program would just crash. I'm not sure what is making my program crash. I know that my code should change the image without problem and that it's reading in the right images to change the original ImageView Button with. Oh and I'm initializing the ImaveView outside of everything so that I can use it in both the onCreate and onActivityResult. Otherwise it wil be outside of the scope of one of those methods. Can someone help me?
This is the code that I'm using.
public class A extends Activity{
private final int Change_Image = 7;
private int Replace_Image = 7;
ImageView spriteImg = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.objecteditscreen);
spriteImg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setClass(getApplicationContext(), com.mobilegamelab.ImagesGridView.class);
startActivityForResult(intent, Change_Image);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch(requestCode)
{
case Change_Image:
if(resultCode== RESULT_OK)
{
int result = data.getIntExtra("newPicture", 0);
Replace_Image = result;
if (Replace_Image == 0)
{
spriteImg.setImageResource(R.drawable.sample_2);
}
else if (Replace_Image == 1)
{
spriteImg.setImageResource(R.drawable.sample_3);
}
else if (Replace_Image == 2)
{
spriteImg.setImageResource(R.drawable.sample_4);
}
else if (Replace_Image == 3)
{
spriteImg.setImageResource(R.drawable.sample_5);
}
else if (Replace_Image == 4)
{
spriteImg.setImageResource(R.drawable.sample_6);
}
else if (Replace_Image == 5)
{
spriteImg.setImageResource(R.drawable.sample_7);
}
else if (Replace_Image == 6)
{
spriteImg.setImageResource(R.drawable.sample8);
}
}
break;
}
}
This is my gridview class
public class ImagesGridView extends Activity {
/** Called when the activity is first created. */
Intent sentIntent;
static int picLocation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gridview);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
sentIntent = getIntent();
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
picLocation = position;
Intent response = new Intent();
response.putExtra("newPicture", picLocation);
setResult(RESULT_OK, response);
finish();
}
});
}
}
| 0 |
3,118,372 | 06/25/2010 13:30:49 | 353,483 | 05/29/2010 08:49:50 | 1,045 | 62 | Usecases for method hiding using new | This is more or less an exact duplicate of [this post][1], but as I cannot edit it, I started this. Feel free to move something over and close this one.
Using method hiding with new seems like a dangerous feature, and given the discussion in the other thread, it seems it's not only I who have problems finding a valid use case for this. Any methods accepting Base won't use Derived's Method.
public class Base
{
public void Method()
{
Console.WriteLine("Base");
}
}
public class Derived : Base
{
public new void Method()
{
Console.WriteLine("Derived");
}
}
var derived = new Derived();
derived.Method(); // "Derived"
((Base)derived).Method(); // "Base"
So what are some valid use cases for new that is difficult to solve with other features?
[1]: http://stackoverflow.com/questions/3117838/why-do-we-need-the-new-keyword-and-why-is-the-default-behavior-to-hide-and-not-ov | c# | null | null | null | null | null | open | Usecases for method hiding using new
===
This is more or less an exact duplicate of [this post][1], but as I cannot edit it, I started this. Feel free to move something over and close this one.
Using method hiding with new seems like a dangerous feature, and given the discussion in the other thread, it seems it's not only I who have problems finding a valid use case for this. Any methods accepting Base won't use Derived's Method.
public class Base
{
public void Method()
{
Console.WriteLine("Base");
}
}
public class Derived : Base
{
public new void Method()
{
Console.WriteLine("Derived");
}
}
var derived = new Derived();
derived.Method(); // "Derived"
((Base)derived).Method(); // "Base"
So what are some valid use cases for new that is difficult to solve with other features?
[1]: http://stackoverflow.com/questions/3117838/why-do-we-need-the-new-keyword-and-why-is-the-default-behavior-to-hide-and-not-ov | 0 |
5,637,253 | 04/12/2011 14:54:26 | 284,740 | 03/02/2010 20:20:47 | 23 | 0 | What is the use of SPHttpUtility.NoEncode method? | Does anybody know what is the usefulness of the SPHttpUtility.NoEncode method? It seems like it takes a string as parameters and returns it without any modification.
Is there a case where you can use this and I'm missing it? | sharepoint | internals | null | null | null | null | open | What is the use of SPHttpUtility.NoEncode method?
===
Does anybody know what is the usefulness of the SPHttpUtility.NoEncode method? It seems like it takes a string as parameters and returns it without any modification.
Is there a case where you can use this and I'm missing it? | 0 |
5,854,531 | 05/02/2011 07:28:49 | 725,013 | 04/26/2011 08:29:04 | 6 | 0 | how to scroll a banner when i scroll a html page | Actually i want to scroll a banner when i scroll page in the html
And it will be scroll in the fix length
please help me | php | null | null | null | null | null | open | how to scroll a banner when i scroll a html page
===
Actually i want to scroll a banner when i scroll page in the html
And it will be scroll in the fix length
please help me | 0 |
7,914,659 | 10/27/2011 10:31:29 | 397,244 | 07/20/2010 20:04:08 | 116 | 3 | Where can I get the source code for the Google IO Scheduler app for android smartphones? | If it exists. I've just found for tablet.
Thanks. | android | googleio | null | null | null | 10/27/2011 13:44:10 | not a real question | Where can I get the source code for the Google IO Scheduler app for android smartphones?
===
If it exists. I've just found for tablet.
Thanks. | 1 |
1,101,116 | 07/08/2009 23:38:25 | 48,211 | 12/21/2008 23:41:55 | 154 | 12 | Small message parser, whats bad? | i made a small parser that will go though a message and replace $user with a certain user and so on.
besides the basic keywords, i wanted it to replace dates like this:
$datemo10 with todays date plus 10 months
$datedd03 with todays date plus 3 days
$datehh07 with todays date plus 7 hours
$datemm12 with todays date plus 12 minutes
$datess15 with todays date plus 15 seconds
This is what i got working..
const string Identifier = "$";
const string TimeFormat = "HH:mm:ss dd-MM-yyyy";
public static string Encode(string Author, string Recipent, string input)
{
Dictionary<string, string> keywords = new Dictionary<string, string>();
keywords.Add("bye", "With kind regards " + identify("me"));
keywords.Add("user", Recipent);
keywords.Add("me", Author);
keywords.Add("now", DateTime.Now.ToString(TimeFormat));
keywords.Add("date", "");
string result = input;
foreach (KeyValuePair<string, string> keyword in keywords)
{
if (keyword.Key.ToLower() == "date")
{
int addedLength = 0;
foreach (Match match in Regex.Matches(input, "\\" + identify(keyword.Key)))
{
string mode = input.Substring(match.Index + addedLength + match.Length, 2);
string stringInteger = input.Substring(match.Index + addedLength + match.Length + 2, 2);
int integer;
if (int.TryParse(stringInteger, out integer) && !mode.Contains(" "))
{
if (mode == "ss")
{
string dateTime = DateTime.Now.AddSeconds(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "mm")
{
string dateTime = DateTime.Now.AddMinutes(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "hh")
{
string dateTime = DateTime.Now.AddHours(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "dd")
{
string dateTime = DateTime.Now.AddDays(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "mo")
{
string dateTime = DateTime.Now.AddMonths(integer).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "yy")
{
string dateTime = DateTime.Now.AddYears(integer).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
}
}
}
else
{
input = Regex.Replace(input, "\\" + identify(keyword.Key), keyword.Value);
}
}
return input;
}
protected static string identify(string val)
{
return Identifier + val;
}
I feel fine about keeping the keywords that needs to be replaced in a dictionary, but i really dont like the way im parsing and replacing the dates.
But as im pretty new to the whole programming world, this is the only way i was able to make it work. Though im perfectly able to see why it could be so much better, if you have any idea on how to make it work in a less hacky way, please tell me :)
Tear it apart, but please do so in a constructive matter.
How can i make it better?
I know there is quite a bit repetitive code.. Shhh
Thanks :) | c# | null | null | null | null | null | open | Small message parser, whats bad?
===
i made a small parser that will go though a message and replace $user with a certain user and so on.
besides the basic keywords, i wanted it to replace dates like this:
$datemo10 with todays date plus 10 months
$datedd03 with todays date plus 3 days
$datehh07 with todays date plus 7 hours
$datemm12 with todays date plus 12 minutes
$datess15 with todays date plus 15 seconds
This is what i got working..
const string Identifier = "$";
const string TimeFormat = "HH:mm:ss dd-MM-yyyy";
public static string Encode(string Author, string Recipent, string input)
{
Dictionary<string, string> keywords = new Dictionary<string, string>();
keywords.Add("bye", "With kind regards " + identify("me"));
keywords.Add("user", Recipent);
keywords.Add("me", Author);
keywords.Add("now", DateTime.Now.ToString(TimeFormat));
keywords.Add("date", "");
string result = input;
foreach (KeyValuePair<string, string> keyword in keywords)
{
if (keyword.Key.ToLower() == "date")
{
int addedLength = 0;
foreach (Match match in Regex.Matches(input, "\\" + identify(keyword.Key)))
{
string mode = input.Substring(match.Index + addedLength + match.Length, 2);
string stringInteger = input.Substring(match.Index + addedLength + match.Length + 2, 2);
int integer;
if (int.TryParse(stringInteger, out integer) && !mode.Contains(" "))
{
if (mode == "ss")
{
string dateTime = DateTime.Now.AddSeconds(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "mm")
{
string dateTime = DateTime.Now.AddMinutes(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "hh")
{
string dateTime = DateTime.Now.AddHours(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "dd")
{
string dateTime = DateTime.Now.AddDays(Convert.ToDouble(integer)).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "mo")
{
string dateTime = DateTime.Now.AddMonths(integer).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
else if (mode == "yy")
{
string dateTime = DateTime.Now.AddYears(integer).ToString(TimeFormat);
input = input.Remove(match.Index + addedLength, match.Length + 4);
input = input.Insert(match.Index + addedLength, dateTime);
addedLength += (dateTime.Length - (match.Length + 4));
}
}
}
}
else
{
input = Regex.Replace(input, "\\" + identify(keyword.Key), keyword.Value);
}
}
return input;
}
protected static string identify(string val)
{
return Identifier + val;
}
I feel fine about keeping the keywords that needs to be replaced in a dictionary, but i really dont like the way im parsing and replacing the dates.
But as im pretty new to the whole programming world, this is the only way i was able to make it work. Though im perfectly able to see why it could be so much better, if you have any idea on how to make it work in a less hacky way, please tell me :)
Tear it apart, but please do so in a constructive matter.
How can i make it better?
I know there is quite a bit repetitive code.. Shhh
Thanks :) | 0 |
3,943,386 | 10/15/2010 14:53:00 | 477,011 | 10/15/2010 14:46:07 | 1 | 0 | encrypt your hardisk in c# | please tell me how to secure hardisk programmtically through c# .....
like a user want to open hardisk and first he have to give a password to acces it if the password is wrong then hard disk is hide from that user..
if any one have idea than please tell me ..
regards,
ashraf paracha
| c#-4.0 | null | null | null | null | 10/15/2010 15:31:18 | not a real question | encrypt your hardisk in c#
===
please tell me how to secure hardisk programmtically through c# .....
like a user want to open hardisk and first he have to give a password to acces it if the password is wrong then hard disk is hide from that user..
if any one have idea than please tell me ..
regards,
ashraf paracha
| 1 |
3,063,934 | 06/17/2010 17:16:20 | 369,599 | 06/17/2010 17:15:04 | 1 | 0 | Upgrade maven.2.0.8 to maven.2.0.9 on Ubuntu Hardy Heron (8.04) | Ubuntu packages for 8.04 only goes upto version 2.0.8 of Maven. How do I install maven 2.0.9 package using apt-get or other Ubuntu package installer ? Thanks. | maven-2 | maven | ubuntu-8.04 | null | null | null | open | Upgrade maven.2.0.8 to maven.2.0.9 on Ubuntu Hardy Heron (8.04)
===
Ubuntu packages for 8.04 only goes upto version 2.0.8 of Maven. How do I install maven 2.0.9 package using apt-get or other Ubuntu package installer ? Thanks. | 0 |
7,088,405 | 08/17/2011 05:40:14 | 898,014 | 08/17/2011 05:40:14 | 1 | 0 | Kernel development | Is it still possible for someone to learn and start contributing to the linux kernel? looks like the contributor list seems to be dominated by paid employees from large companies. Is there still a chance that one can get their patches or bugs in the kernel or is it sort of saturated with great developers? I'm thinking on focussing on the networking subsystem. Sorry, if all this sounds too noobish, but any opinions on all this? Is it even worth it to start on this route? I plan to spend my evenings and weekends for however long it takes, assuming I will be able to make some contribution.
Thanks.
| linux | networking | kernel | null | null | 08/17/2011 06:30:16 | not constructive | Kernel development
===
Is it still possible for someone to learn and start contributing to the linux kernel? looks like the contributor list seems to be dominated by paid employees from large companies. Is there still a chance that one can get their patches or bugs in the kernel or is it sort of saturated with great developers? I'm thinking on focussing on the networking subsystem. Sorry, if all this sounds too noobish, but any opinions on all this? Is it even worth it to start on this route? I plan to spend my evenings and weekends for however long it takes, assuming I will be able to make some contribution.
Thanks.
| 4 |
3,067,205 | 06/18/2010 04:28:22 | 258,648 | 01/25/2010 17:55:18 | 4 | 3 | Best XML Based Database | I had been assigned to develop a system on where we would get a XML from multiple sources (millions of xml) and put them in some database like and judging from the xml i would receive, there wont be any concrete structure even if they are from the same source. With this reason i think i cannot suggest RDMS and currently looking at NoSQL databases. We need a system that could do CRUD and is fast on Read.
I had been looking at MarkLogic and eXist, which are both XML based NoSQL databases, have anyone had experience with them? and any other suggestion? Thanks | database-design | nosql | null | null | null | 09/13/2011 12:45:20 | not constructive | Best XML Based Database
===
I had been assigned to develop a system on where we would get a XML from multiple sources (millions of xml) and put them in some database like and judging from the xml i would receive, there wont be any concrete structure even if they are from the same source. With this reason i think i cannot suggest RDMS and currently looking at NoSQL databases. We need a system that could do CRUD and is fast on Read.
I had been looking at MarkLogic and eXist, which are both XML based NoSQL databases, have anyone had experience with them? and any other suggestion? Thanks | 4 |
6,997,263 | 08/09/2011 13:53:53 | 521,180 | 11/26/2010 09:29:14 | 443 | 15 | How similar is C# to C++ | I am reading [this C# tutorial][1] and it says "similar to Java (75%) C++(10%)". is that true? I thought C# and C++ were the same language except for few handy abstractions which visual studio provides.
[1]: http://ssw.jku.at/Teaching/Lectures/CSharp/Tutorial/Part1.pdf | c# | c++ | null | null | null | 08/09/2011 13:55:23 | not constructive | How similar is C# to C++
===
I am reading [this C# tutorial][1] and it says "similar to Java (75%) C++(10%)". is that true? I thought C# and C++ were the same language except for few handy abstractions which visual studio provides.
[1]: http://ssw.jku.at/Teaching/Lectures/CSharp/Tutorial/Part1.pdf | 4 |
9,998,366 | 04/03/2012 17:29:55 | 456,106 | 09/23/2010 11:39:46 | 2,178 | 95 | Python lists vs C arrays : 100x slower? | It was my understanding that Python lists where implemented as vector.
That's why I can't explain why the following code is 100x slower in Python (in 3.1.3, and "only" 65x in python 3.2) than the equivalent C code.
It simply repeatedly extract the maximum of a list :
nbValues = int(input())
values = list(map( int, input().split() ))
for loop in range(nbValues):
idMax = 0
for idValue in range(nbValues):
if values[idMax] < values[idValue]:
idMax = idValue
print(valpython3es[idMax], end = ' ')
values[idMax] = values[nbValues- 1]
nbValues= nbValues - 1
I kown how to do it faster (using the internal `max` function for example) but this was an exercise for high-school students and we are only teaching them the basics (if/else, for, while and arrays), not all the functions available in Python.
Is there a way to improve the speed while keeping the same structure ? I've tried Python's arrays but the speed is roughly the same.
Does anyone know why internally Python is so much slower for arrays manipulation ? | python | c | arrays | performance | list | 04/03/2012 18:49:25 | not constructive | Python lists vs C arrays : 100x slower?
===
It was my understanding that Python lists where implemented as vector.
That's why I can't explain why the following code is 100x slower in Python (in 3.1.3, and "only" 65x in python 3.2) than the equivalent C code.
It simply repeatedly extract the maximum of a list :
nbValues = int(input())
values = list(map( int, input().split() ))
for loop in range(nbValues):
idMax = 0
for idValue in range(nbValues):
if values[idMax] < values[idValue]:
idMax = idValue
print(valpython3es[idMax], end = ' ')
values[idMax] = values[nbValues- 1]
nbValues= nbValues - 1
I kown how to do it faster (using the internal `max` function for example) but this was an exercise for high-school students and we are only teaching them the basics (if/else, for, while and arrays), not all the functions available in Python.
Is there a way to improve the speed while keeping the same structure ? I've tried Python's arrays but the speed is roughly the same.
Does anyone know why internally Python is so much slower for arrays manipulation ? | 4 |
8,416,009 | 12/07/2011 13:23:36 | 564,230 | 01/05/2011 16:24:36 | 41 | 0 | Display Video on Linux | I need to write a small software that will show video.
I don't know any thing about graphics at C.
What classes are there?
Please point me to a place to start from.
Thanks,
Nahum | c | linux | video | null | null | 12/07/2011 17:31:02 | not a real question | Display Video on Linux
===
I need to write a small software that will show video.
I don't know any thing about graphics at C.
What classes are there?
Please point me to a place to start from.
Thanks,
Nahum | 1 |
8,628,552 | 12/25/2011 06:44:11 | 1,015,002 | 10/26/2011 16:25:20 | 48 | 1 | Dsiplaying conversation in Android like iMessage in iOS | I'm trying to write an Android application that needs to show the conversation between two person. Is it possible to implement it so that it's UI looks like iMessage in iOS?
(http://www.apple.com/ipodtouch/built-in-apps/messages.html) . On the other hand, is it possible to display the first person's messages on the left, and the second person's messages on the right ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/XLaJI.png
My first idea is to use an array of TextView, dynamically in Java code, setting their gravity to right and left. Is it OK? What about OutOfMemoryException ?
Regards . | android | message | discussion | null | null | 04/05/2012 15:54:33 | not a real question | Dsiplaying conversation in Android like iMessage in iOS
===
I'm trying to write an Android application that needs to show the conversation between two person. Is it possible to implement it so that it's UI looks like iMessage in iOS?
(http://www.apple.com/ipodtouch/built-in-apps/messages.html) . On the other hand, is it possible to display the first person's messages on the left, and the second person's messages on the right ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/XLaJI.png
My first idea is to use an array of TextView, dynamically in Java code, setting their gravity to right and left. Is it OK? What about OutOfMemoryException ?
Regards . | 1 |
10,327,741 | 04/26/2012 05:33:10 | 384,619 | 07/06/2010 14:05:29 | 358 | 6 | FIFO based stock inventory valuation in SQL Server | I have a stock transaction table like this:
Item Date TxnType Qty Price
ABC 01-April-2012 IN 200 750.00
ABC 05-April-2012 OUT 100
ABC 10-April-2012 IN 50 700.00
ABC 16-April-2012 IN 75 800.00
ABC 25-April-2012 OUT 175
XYZ 02-April-2012 IN 150 350.00
XYZ 08-April-2012 OUT 120
XYZ 12-April-2012 OUT 10
XYZ 24-April-2012 IN 90 340.00
I need the value of the inventory for each item in FIFO (First in first out) meaning the first purchased item should be consumed first.
The output stock valuation of the above data is:
Item Qty Value
ABC 50 40000.00
XYZ 110 37600.00
Please help me to get the solution. | tsql | sql-server-2005 | null | null | null | 04/26/2012 11:53:57 | not a real question | FIFO based stock inventory valuation in SQL Server
===
I have a stock transaction table like this:
Item Date TxnType Qty Price
ABC 01-April-2012 IN 200 750.00
ABC 05-April-2012 OUT 100
ABC 10-April-2012 IN 50 700.00
ABC 16-April-2012 IN 75 800.00
ABC 25-April-2012 OUT 175
XYZ 02-April-2012 IN 150 350.00
XYZ 08-April-2012 OUT 120
XYZ 12-April-2012 OUT 10
XYZ 24-April-2012 IN 90 340.00
I need the value of the inventory for each item in FIFO (First in first out) meaning the first purchased item should be consumed first.
The output stock valuation of the above data is:
Item Qty Value
ABC 50 40000.00
XYZ 110 37600.00
Please help me to get the solution. | 1 |
2,228,439 | 02/09/2010 10:52:04 | 239,411 | 10/19/2009 06:05:26 | 48 | 0 | JQuery - downloading a url that returns 404 while processing and 200 when data is available | So I have a URL (foo) that I need to download after my page has finished rendering or the element that I want to show it in is on the page i.e. I'll call this function that I'm asking about from my element.
The problem is I have to keep downloading the URL until it returns 200, it starts of saying 404, and gives 200 and a bunch of other headers, once it's done.
Can anyone think of a quick and easy way of doing this? I'm sort of brain-dead @ 2:50AM :( | jquery | javascript | url | download | parsing | null | open | JQuery - downloading a url that returns 404 while processing and 200 when data is available
===
So I have a URL (foo) that I need to download after my page has finished rendering or the element that I want to show it in is on the page i.e. I'll call this function that I'm asking about from my element.
The problem is I have to keep downloading the URL until it returns 200, it starts of saying 404, and gives 200 and a bunch of other headers, once it's done.
Can anyone think of a quick and easy way of doing this? I'm sort of brain-dead @ 2:50AM :( | 0 |
10,841,796 | 05/31/2012 21:52:17 | 393,087 | 07/15/2010 18:26:42 | 1,501 | 5 | is there a way to execute system command with given priority? | I mean this command:
system("myprogram.exe");
Is there a way to make it run for example in below-normal priority mode ? | c++ | windows | winapi | thread-priority | null | null | open | is there a way to execute system command with given priority?
===
I mean this command:
system("myprogram.exe");
Is there a way to make it run for example in below-normal priority mode ? | 0 |
7,539,356 | 09/24/2011 13:33:36 | 962,650 | 09/24/2011 13:18:14 | 1 | 0 | Unusual usage of aspect-oriented programming | I am a student, and I started to work on my graduation thesis. I decided to work in such specific field as aspect-oriented programming, but I haven't decided yet what particular topic I'll choose and I'm searching for something new. Could you give me an advice? For what purposes is AOP not used yet but potentially can be? In what direction can my research be done? | research | null | null | null | null | 09/24/2011 16:11:38 | off topic | Unusual usage of aspect-oriented programming
===
I am a student, and I started to work on my graduation thesis. I decided to work in such specific field as aspect-oriented programming, but I haven't decided yet what particular topic I'll choose and I'm searching for something new. Could you give me an advice? For what purposes is AOP not used yet but potentially can be? In what direction can my research be done? | 2 |
11,078,356 | 06/18/2012 07:14:05 | 1,462,924 | 06/18/2012 06:46:28 | 1 | 0 | Xcode 4.3 Storyboard - Passing table cell value from one tab bar to the second tab bar without navigation controller | Please help me to figure this out. I am having two tab bar items in a tab bar application. First tab bar view with UITableView and second tab bar view with a label. I trying to pass table cell value to second tab view, by clicking a table cell and showing the value in the label of second tab view. The tab bar controller at the bottoms should be still visible. The main thing is I want the respective tab should be selected. I am using Xcode 4.3.2. This is something, will look like, I want to open a tab bar view from another tab bar view with a click of table cell. Thanks | uitabbarcontroller | xcode4.3 | null | null | null | 06/20/2012 13:17:47 | not a real question | Xcode 4.3 Storyboard - Passing table cell value from one tab bar to the second tab bar without navigation controller
===
Please help me to figure this out. I am having two tab bar items in a tab bar application. First tab bar view with UITableView and second tab bar view with a label. I trying to pass table cell value to second tab view, by clicking a table cell and showing the value in the label of second tab view. The tab bar controller at the bottoms should be still visible. The main thing is I want the respective tab should be selected. I am using Xcode 4.3.2. This is something, will look like, I want to open a tab bar view from another tab bar view with a click of table cell. Thanks | 1 |
3,356,742 | 07/28/2010 19:36:05 | 270,663 | 02/10/2010 22:39:45 | 15 | 2 | Best way to load module/class from lib folder in Rails 3? | Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore,
what would be the best way to load them?
From github:
> A few changes were done in this commit:
>
> Do not autoload code in *lib* for applications (now you need to explicitly
> require them). This makes an application behave closer to an engine
> (code in lib is still autoloaded for plugins); | ruby-on-rails | class | module | autoload | ruby-on-rails-3 | null | open | Best way to load module/class from lib folder in Rails 3?
===
Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore,
what would be the best way to load them?
From github:
> A few changes were done in this commit:
>
> Do not autoload code in *lib* for applications (now you need to explicitly
> require them). This makes an application behave closer to an engine
> (code in lib is still autoloaded for plugins); | 0 |
9,068,855 | 01/30/2012 18:28:59 | 800,639 | 06/16/2011 01:20:15 | 1,584 | 53 | Having issue with datatables | Using datatables on my project. Got several questions about it
Please take a look at [this page][1]
![enter image description here][2]
1. Used tabletools plug-in to create new buttons in instrument panel. But why "Show xx entry" drop-down list hidden? How can I unhide it? Take a look at [default table][3] You'll see what I mean by "Show xx entry" drop-down list.
2. Head rows moved to the left. They are not staying at right place. For Ex. 1 must be under Item No and so on. How can I fix it?
[1]: http://tural.no-ip.org/?page=db
[2]: http://i.stack.imgur.com/ph3vX.jpg
[3]: http://www.datatables.net/index | javascript | jquery | css | jquery-ui | datatables | 01/31/2012 17:25:23 | not a real question | Having issue with datatables
===
Using datatables on my project. Got several questions about it
Please take a look at [this page][1]
![enter image description here][2]
1. Used tabletools plug-in to create new buttons in instrument panel. But why "Show xx entry" drop-down list hidden? How can I unhide it? Take a look at [default table][3] You'll see what I mean by "Show xx entry" drop-down list.
2. Head rows moved to the left. They are not staying at right place. For Ex. 1 must be under Item No and so on. How can I fix it?
[1]: http://tural.no-ip.org/?page=db
[2]: http://i.stack.imgur.com/ph3vX.jpg
[3]: http://www.datatables.net/index | 1 |
3,548,996 | 08/23/2010 15:22:57 | 301,012 | 03/24/2010 16:43:10 | 19 | 1 | I need a way to improve my php programming skills, so far i have been fruitlessly searching on the internet. | I am hoping that you would be able to help me acquire better programming skills | php | programming-languages | null | null | null | 08/23/2010 15:57:52 | not a real question | I need a way to improve my php programming skills, so far i have been fruitlessly searching on the internet.
===
I am hoping that you would be able to help me acquire better programming skills | 1 |
7,697,677 | 10/08/2011 15:05:40 | 251,946 | 01/15/2010 23:48:59 | 176 | 3 | MySQL on Windows - Access denied for user ''@'localhost' - cannot connect from any host | I tried to update my Mysql instance to support remote access. I went to MySQL Administration UI and added % (any host) for user root and removed all other entries.
Now I cannot access MySQL as root from any machine including localhost. What is the best way to fix this?
Thanks | mysql | windows | login | root | access | null | open | MySQL on Windows - Access denied for user ''@'localhost' - cannot connect from any host
===
I tried to update my Mysql instance to support remote access. I went to MySQL Administration UI and added % (any host) for user root and removed all other entries.
Now I cannot access MySQL as root from any machine including localhost. What is the best way to fix this?
Thanks | 0 |
4,195,924 | 11/16/2010 15:43:14 | 12,073 | 09/16/2008 13:06:38 | 101 | 5 | Preg_replace problem, must be trivial | I am obviously doing something completely wrong when it comes to preg_replace.
Say I have a string of text,
"Silence is golden until you are the one silenced." And I want to replace "Silence" with "<strong>Silence</strong>" but not replace the silence in silenced.
Here is the code I have in place:
$q = "Silence is golden until you are the one silenced.";
$card = "Silence";
$pattern = '/\b'.$card.'\b/i';
$q = preg_replace($pattern,'<strong>'.$card.'</strong>',$q);
This is failing and setting $q = ""
What am I doing wrong? | php | regex | null | null | null | 11/16/2010 16:18:28 | too localized | Preg_replace problem, must be trivial
===
I am obviously doing something completely wrong when it comes to preg_replace.
Say I have a string of text,
"Silence is golden until you are the one silenced." And I want to replace "Silence" with "<strong>Silence</strong>" but not replace the silence in silenced.
Here is the code I have in place:
$q = "Silence is golden until you are the one silenced.";
$card = "Silence";
$pattern = '/\b'.$card.'\b/i';
$q = preg_replace($pattern,'<strong>'.$card.'</strong>',$q);
This is failing and setting $q = ""
What am I doing wrong? | 3 |
69,715 | 09/16/2008 06:07:16 | 8,161 | 09/15/2008 15:17:47 | 1 | 1 | Which PHP open source shopping cart solutions have features that benefit me as the web developer? | There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspective.
But which ones are built with the developer in mind? For example, which ones have a decent API so that my custom code doesn't get mingled with the core code or which ones have a well thought through template system so that I can easily customize it for each new client? | php | e-commerce | shopping-cart | null | null | null | open | Which PHP open source shopping cart solutions have features that benefit me as the web developer?
===
There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspective.
But which ones are built with the developer in mind? For example, which ones have a decent API so that my custom code doesn't get mingled with the core code or which ones have a well thought through template system so that I can easily customize it for each new client? | 0 |
11,526,594 | 07/17/2012 16:12:26 | 549,141 | 12/20/2010 20:35:28 | 2,495 | 97 | Does Twitter Bootstrap use jQuery? | Does [Twitter Bootstrap](http://twitter.github.com/bootstrap/) use [jQuery](http://jquery.com/)? If so, what version (number) of jQuery is used, and are all jQuery functions available? | jquery | twitter-bootstrap | null | null | null | 07/17/2012 16:36:40 | not a real question | Does Twitter Bootstrap use jQuery?
===
Does [Twitter Bootstrap](http://twitter.github.com/bootstrap/) use [jQuery](http://jquery.com/)? If so, what version (number) of jQuery is used, and are all jQuery functions available? | 1 |
5,291,035 | 03/13/2011 17:21:14 | 657,709 | 03/13/2011 17:21:14 | 1 | 0 | Fingerprint recognition in java | how to do a fingerprint recognition program in java without any fingerprint reader device, by using fingerprint image.Please help me. | mysql | null | null | null | null | 03/13/2011 19:46:40 | not a real question | Fingerprint recognition in java
===
how to do a fingerprint recognition program in java without any fingerprint reader device, by using fingerprint image.Please help me. | 1 |
4,110,016 | 11/05/2010 20:57:26 | 498,785 | 11/05/2010 20:57:26 | 1 | 0 | Calling wrapped C++ DLL method from C#: passing addresses of integral variables to get output | I need to call a wrapped function from a C++ DLL with the following declaration:
[DllImport(@dllPath, EntryPoint = "Calling_fooBar")]
private static extern int Calling_fooBar( uint* a,
uint* b,
uint* c,
uint* d,
//etc );
Used in this way:
private void getData()
{
uint A, B, C, D; //etc
Calling_fooBar( &A, &B, &C, &D );
Upon doing this, A, B, C, D are all still 0. I'm quite sure the external method in the DLL is working properly so they should have non-zero values.
So I'm guessing I'm passing the address wrong ... or something.
Hopefully this isn't too dumb a question. I can clarify anything if needed
| c# | .net | pointers | dllimport | null | null | open | Calling wrapped C++ DLL method from C#: passing addresses of integral variables to get output
===
I need to call a wrapped function from a C++ DLL with the following declaration:
[DllImport(@dllPath, EntryPoint = "Calling_fooBar")]
private static extern int Calling_fooBar( uint* a,
uint* b,
uint* c,
uint* d,
//etc );
Used in this way:
private void getData()
{
uint A, B, C, D; //etc
Calling_fooBar( &A, &B, &C, &D );
Upon doing this, A, B, C, D are all still 0. I'm quite sure the external method in the DLL is working properly so they should have non-zero values.
So I'm guessing I'm passing the address wrong ... or something.
Hopefully this isn't too dumb a question. I can clarify anything if needed
| 0 |
455,292 | 01/18/2009 15:16:29 | 12,113 | 09/16/2008 13:14:45 | 55 | 2 | Is it possible to create a javascript User-defined function in sqlite | BACKGROUND:
- Firefox 3 includes
[SQLite](http://sqlite.org) version
3.5.9. It also allows extensions, which are written in javascript and
can call the embedded SQLite engine.
- As expected, executing the following
SQL statement 'SELECT "TEXT" REGEX
"T*";' gives an error, since there is
no REGEX function included.
- javascript includes a native regex
function.
- SQLite allows loadable extensions via
SELECT load_extension('filename');
QUESTION:
**Is it possible to load a javascript extension which could be registered
to do REGEX?**
| firefox | sqlite | regex | javascript | null | null | open | Is it possible to create a javascript User-defined function in sqlite
===
BACKGROUND:
- Firefox 3 includes
[SQLite](http://sqlite.org) version
3.5.9. It also allows extensions, which are written in javascript and
can call the embedded SQLite engine.
- As expected, executing the following
SQL statement 'SELECT "TEXT" REGEX
"T*";' gives an error, since there is
no REGEX function included.
- javascript includes a native regex
function.
- SQLite allows loadable extensions via
SELECT load_extension('filename');
QUESTION:
**Is it possible to load a javascript extension which could be registered
to do REGEX?**
| 0 |
9,759,502 | 03/18/2012 15:25:26 | 1,243,862 | 03/01/2012 22:23:06 | 72 | 0 | Resetting Autoincrement in Android SQLite | I have this method which will remove all rows from a table but i also want it to reset the autoincrement so that when a new row is added it will start again. The SQL statement i'm using isnt working due to certain columns not existing. Am i doing it right?
private void rmvall() {
SQLiteDatabase db = appts.getWritableDatabase();
db.delete(TABLE_NAME, null, null);
db.execSQL("DELETE FROM SQLITE_SEQUENCE WHERE NAME = " + TABLE_NAME);
} | android | sqlite | null | null | null | null | open | Resetting Autoincrement in Android SQLite
===
I have this method which will remove all rows from a table but i also want it to reset the autoincrement so that when a new row is added it will start again. The SQL statement i'm using isnt working due to certain columns not existing. Am i doing it right?
private void rmvall() {
SQLiteDatabase db = appts.getWritableDatabase();
db.delete(TABLE_NAME, null, null);
db.execSQL("DELETE FROM SQLITE_SEQUENCE WHERE NAME = " + TABLE_NAME);
} | 0 |
10,952,957 | 06/08/2012 16:51:43 | 1,445,031 | 06/08/2012 16:40:55 | 1 | 0 | How to get a handle to a new Object while unit testing? | How would I test this ValueObject created on the fly in SomeClass without stubbing it out using PowerMock etc?
class ValueOBject {
private String x, y;
getters
setters
}
class SomeClass {
public void foo () {
ValueObject vo = new ValueObject();
vo.setX("some string 1");
vo.setY("some string 2");
faa(vo);
}
public void faa(ValueObject vo) {
// do some more logic on vo here
}
}
class SomeClassTest extends TestCase{
public void testFoo() {
SomeClass s = new SomeClass();
s.foo();
// HOW TO DO THIS?
verify(faa(VAlueObject that is created during foo's run));
}
}
I dont want to use PowerMockito or similar libraries to return a MOCKED object!
Rather a REAL object thats created during execution of the method foo() :
// DONT WANT A MOCKED OBJECT
// @Mock
// private ValueOBject vo;
// henNew(GetEmailInformation.class).withNoArguments().thenReturn(getEmailInformation);
| java | null | null | null | null | null | open | How to get a handle to a new Object while unit testing?
===
How would I test this ValueObject created on the fly in SomeClass without stubbing it out using PowerMock etc?
class ValueOBject {
private String x, y;
getters
setters
}
class SomeClass {
public void foo () {
ValueObject vo = new ValueObject();
vo.setX("some string 1");
vo.setY("some string 2");
faa(vo);
}
public void faa(ValueObject vo) {
// do some more logic on vo here
}
}
class SomeClassTest extends TestCase{
public void testFoo() {
SomeClass s = new SomeClass();
s.foo();
// HOW TO DO THIS?
verify(faa(VAlueObject that is created during foo's run));
}
}
I dont want to use PowerMockito or similar libraries to return a MOCKED object!
Rather a REAL object thats created during execution of the method foo() :
// DONT WANT A MOCKED OBJECT
// @Mock
// private ValueOBject vo;
// henNew(GetEmailInformation.class).withNoArguments().thenReturn(getEmailInformation);
| 0 |
6,985,284 | 08/08/2011 16:29:39 | 245,008 | 01/06/2010 19:40:56 | 460 | 14 | Free tools to test C# Web Service traffic? | I wrote a web service in C#. Now, i need to test the web service traffic to get information like (how long does it take to get response, how many responses can be handled in an hour etc. pretty much statistics about the web service). Is there any tools (free/paid) to get this information? | c# | web-services | statistics | traffic | null | null | open | Free tools to test C# Web Service traffic?
===
I wrote a web service in C#. Now, i need to test the web service traffic to get information like (how long does it take to get response, how many responses can be handled in an hour etc. pretty much statistics about the web service). Is there any tools (free/paid) to get this information? | 0 |
6,032,689 | 05/17/2011 14:51:22 | 476,460 | 10/15/2010 02:05:45 | 101 | 0 | iOS Developer Program: Is it possible to have a bank account in a different country from the country in which the company is registered? | I'm looking to set up a company for iOS app development. This company will probably be an offshore company (Hong Kong or British Virgin Islands), primarily because these are quick and cheap to set up.
However, for practical reasons, my bank account may be in a different country.
Does Apple prohibit this in any way? I've looked through signup information and iTunes Connect documentation, but can not see anything related to this.
I'd love to know if anyone here has done something similar and could share their experiences. | ios | apple | null | null | null | 05/18/2011 21:13:58 | off topic | iOS Developer Program: Is it possible to have a bank account in a different country from the country in which the company is registered?
===
I'm looking to set up a company for iOS app development. This company will probably be an offshore company (Hong Kong or British Virgin Islands), primarily because these are quick and cheap to set up.
However, for practical reasons, my bank account may be in a different country.
Does Apple prohibit this in any way? I've looked through signup information and iTunes Connect documentation, but can not see anything related to this.
I'd love to know if anyone here has done something similar and could share their experiences. | 2 |
6,751,340 | 07/19/2011 17:24:58 | 817,759 | 06/27/2011 16:20:31 | 1 | 0 | Getting the MAC Address in Objective-C | How do I get the MAC address of the computer in Objective-C? I was using the following code but it started crashing once I switched to using the LLVM compiler. Can anyone tell me how to fix this code or give me new code that works? I found a way to do it in 10.6+, but I need it to work with 10.5 too.
Thanks!
void GetHWAddresses()
{
struct ifconf ifc;
struct ifreq *ifr;
int i, sockfd;
char buffer[BUFFERSIZE], *cp, *cplim;
char temp[80];
for (i=0; i<MAXADDRS; ++i)
{
hw_addrs[i] = NULL;
}
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd < 0)
{
perror("socket failed");
return;
}
ifc.ifc_len = BUFFERSIZE;
ifc.ifc_buf = buffer;
if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
{
perror("ioctl error");
close(sockfd);
return;
}
ifr = ifc.ifc_req;
cplim = buffer + ifc.ifc_len;
for (cp=buffer; cp < cplim; )
{
ifr = (struct ifreq *)cp;
if (ifr->ifr_addr.sa_family == AF_LINK)
{
struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
int a,b,c,d,e,f;
int i;
strcpy(temp, (char *)ether_ntoa(LLADDR(sdl)));
sscanf(temp, "%x:%x:%x:%x:%x:%x", &a, &b, &c, &d, &e, &f);
sprintf(temp, "%02X:%02X:%02X:%02X:%02X:%02X",a,b,c,d,e,f);
for (i=0; i<MAXADDRS; ++i)
{
if ((if_names[i] != NULL) && (strcmp(ifr->ifr_name, if_names[i]) == 0))
{
if (hw_addrs[i] == NULL)
{
hw_addrs[i] = (char *)malloc(strlen(temp)+1);
strcpy(hw_addrs[i], temp);
break;
}
}
}
}
cp += sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
}
close(sockfd);
}
| objective-c | osx | networking | address | null | null | open | Getting the MAC Address in Objective-C
===
How do I get the MAC address of the computer in Objective-C? I was using the following code but it started crashing once I switched to using the LLVM compiler. Can anyone tell me how to fix this code or give me new code that works? I found a way to do it in 10.6+, but I need it to work with 10.5 too.
Thanks!
void GetHWAddresses()
{
struct ifconf ifc;
struct ifreq *ifr;
int i, sockfd;
char buffer[BUFFERSIZE], *cp, *cplim;
char temp[80];
for (i=0; i<MAXADDRS; ++i)
{
hw_addrs[i] = NULL;
}
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd < 0)
{
perror("socket failed");
return;
}
ifc.ifc_len = BUFFERSIZE;
ifc.ifc_buf = buffer;
if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
{
perror("ioctl error");
close(sockfd);
return;
}
ifr = ifc.ifc_req;
cplim = buffer + ifc.ifc_len;
for (cp=buffer; cp < cplim; )
{
ifr = (struct ifreq *)cp;
if (ifr->ifr_addr.sa_family == AF_LINK)
{
struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
int a,b,c,d,e,f;
int i;
strcpy(temp, (char *)ether_ntoa(LLADDR(sdl)));
sscanf(temp, "%x:%x:%x:%x:%x:%x", &a, &b, &c, &d, &e, &f);
sprintf(temp, "%02X:%02X:%02X:%02X:%02X:%02X",a,b,c,d,e,f);
for (i=0; i<MAXADDRS; ++i)
{
if ((if_names[i] != NULL) && (strcmp(ifr->ifr_name, if_names[i]) == 0))
{
if (hw_addrs[i] == NULL)
{
hw_addrs[i] = (char *)malloc(strlen(temp)+1);
strcpy(hw_addrs[i], temp);
break;
}
}
}
}
cp += sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
}
close(sockfd);
}
| 0 |
3,544,646 | 08/23/2010 03:50:28 | 665,392 | 02/27/2010 09:27:37 | 44 | 10 | How Delphi objects work in code | I have been looking at system.pas
Delphi can call up to 65,000 memory blocks from windows
When Delphi makes an object dose it call a memory block for its data
And if so does the class some how load a register with a memory address for that memory block and an address for the methods too that is placed in another register.
Does any one know anything about this?
J Lex Dean.
| delphi | null | null | null | null | 08/01/2011 21:47:43 | not a real question | How Delphi objects work in code
===
I have been looking at system.pas
Delphi can call up to 65,000 memory blocks from windows
When Delphi makes an object dose it call a memory block for its data
And if so does the class some how load a register with a memory address for that memory block and an address for the methods too that is placed in another register.
Does any one know anything about this?
J Lex Dean.
| 1 |
9,982,487 | 04/02/2012 19:20:43 | 1,296,363 | 03/27/2012 18:47:23 | 13 | 0 | Regex: how to stop match a url if it fits one pattern | I'm writing a url rewrite regex to find strings having dash between each slash pair, for example,
/aaa-bb/cc/dd-ee-ff/gg should match aaa-bb and dd-ee-ff.
now I need it match nothing if url contains /test/, so for url /aaa-bb/cc/test/dd-ee-ff/gg, it should match nothing.
I have written a regex
/[\w]+-([\w]+(?!\.)-?)+
it will find all strings contains -, but I can't add the pattern for the /test/ part.
Any Help will be appreciated! | regex | null | null | null | null | null | open | Regex: how to stop match a url if it fits one pattern
===
I'm writing a url rewrite regex to find strings having dash between each slash pair, for example,
/aaa-bb/cc/dd-ee-ff/gg should match aaa-bb and dd-ee-ff.
now I need it match nothing if url contains /test/, so for url /aaa-bb/cc/test/dd-ee-ff/gg, it should match nothing.
I have written a regex
/[\w]+-([\w]+(?!\.)-?)+
it will find all strings contains -, but I can't add the pattern for the /test/ part.
Any Help will be appreciated! | 0 |
6,014,852 | 05/16/2011 08:37:14 | 521,710 | 11/26/2010 18:46:31 | 62 | 0 | How to find a website's Page rank for a particular key word | How to find a website's Google / Yahoo / Bing Page rank for a particular keyword.
and also a page rank of a website.
Thanks a lot
| java | php | google | website | seo | 05/26/2011 13:00:46 | off topic | How to find a website's Page rank for a particular key word
===
How to find a website's Google / Yahoo / Bing Page rank for a particular keyword.
and also a page rank of a website.
Thanks a lot
| 2 |
4,391,037 | 12/08/2010 18:45:02 | 535,431 | 12/08/2010 18:45:02 | 1 | 0 | Listing a linked list | I wrote a program. It takes data from a text file to a linked list word by word. But there is a problem at listing the words.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct list
{
char *data;
struct list *next;
} node;
int main()
{
int i;
char *word = NULL;
char line[1000];
node *root,*temp;
root = (node *) malloc(sizeof(node));
temp = root;
FILE *f = fopen("test.txt","r");
while (fgets( line, sizeof(line), f ))
for (word = strtok(line, " "); word; word = strtok(NULL, " "))
{
temp->data = word;
temp->next=(node *) malloc(sizeof(node));
temp=temp->next;
}
fclose(f);
temp =root;
for(i=0; i<10; i++)
{
printf("%s\n",temp->data);
temp=temp->next;
}
return 0;
}
| c | null | null | null | null | null | open | Listing a linked list
===
I wrote a program. It takes data from a text file to a linked list word by word. But there is a problem at listing the words.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct list
{
char *data;
struct list *next;
} node;
int main()
{
int i;
char *word = NULL;
char line[1000];
node *root,*temp;
root = (node *) malloc(sizeof(node));
temp = root;
FILE *f = fopen("test.txt","r");
while (fgets( line, sizeof(line), f ))
for (word = strtok(line, " "); word; word = strtok(NULL, " "))
{
temp->data = word;
temp->next=(node *) malloc(sizeof(node));
temp=temp->next;
}
fclose(f);
temp =root;
for(i=0; i<10; i++)
{
printf("%s\n",temp->data);
temp=temp->next;
}
return 0;
}
| 0 |
8,094,517 | 11/11/2011 13:16:48 | 413,026 | 08/06/2010 12:33:38 | 223 | 14 | stream my screen to fms | I need to stream my desktop and camera to flash media server. streaming webcam is possible and there are no problems with it, but streaming my desktop as I understand needs some application to be installed on the computer. Where can I get more information about this or what platform shall I use to make my desktop stream. any suggestions?
This is also possible using java applet or ActiveX plugin, but I don't have big experience with them. If this is easier way to do the task could you please provide links or any information about it.
Thank you in advance | java | flash | stream | fms | screencasting | 11/11/2011 15:21:16 | off topic | stream my screen to fms
===
I need to stream my desktop and camera to flash media server. streaming webcam is possible and there are no problems with it, but streaming my desktop as I understand needs some application to be installed on the computer. Where can I get more information about this or what platform shall I use to make my desktop stream. any suggestions?
This is also possible using java applet or ActiveX plugin, but I don't have big experience with them. If this is easier way to do the task could you please provide links or any information about it.
Thank you in advance | 2 |
4,916,078 | 02/06/2011 21:00:24 | 604,037 | 02/05/2011 02:11:24 | 1 | 0 | how come this android/java code does not work? | Hey guys, ive been trying to repeat the code below to set ringtones from buttons (longclick), and the code below only saves the first buttons sound to the phone as notifcations or ringtone, and it wont save the other sounds, but still displays the menu as they were saved.
any clues? this is driving me crazy thanks.
package com.soundboard;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import com.soundboard.SoundManager;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class Soundboard extends Activity {
private SoundManager mSoundManager;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mSoundManager = new SoundManager();
mSoundManager.initSounds(getBaseContext());
mSoundManager.addSound(1, R.raw.sound1);
mSoundManager.addSound(2, R.raw.sound2);
mSoundManager.addSound(3, R.raw.sound3);
mSoundManager.addSound(4, R.raw.sound4);
mSoundManager.addSound(5, R.raw.sound5);
mSoundManager.addSound(6, R.raw.sound6);
mSoundManager.addSound(7, R.raw.sound7);
mSoundManager.addSound(8, R.raw.sound8);
mSoundManager.addSound(9, R.raw.sound9);
mSoundManager.addSound(10, R.raw.sound10);
mSoundManager.addSound(11, R.raw.sound11);
mSoundManager.addSound(12, R.raw.sound12);
mSoundManager.addSound(13, R.raw.sound13);
mSoundManager.addSound(14, R.raw.sound14);
mSoundManager.addSound(15, R.raw.sound15);
mSoundManager.addSound(16, R.raw.sound16);
mSoundManager.addSound(17, R.raw.sound17);
mSoundManager.addSound(18, R.raw.sound18);
mSoundManager.addSound(19, R.raw.sound19);
mSoundManager.addSound(20, R.raw.sound20);
mSoundManager.addSound(21, R.raw.sound21);
mSoundManager.addSound(22, R.raw.sound22);
mSoundManager.addSound(23, R.raw.sound23);
mSoundManager.addSound(24, R.raw.sound24);
mSoundManager.addSound(25, R.raw.sound25);
mSoundManager.addSound(26, R.raw.sound26);
mSoundManager.addSound(27, R.raw.sound27);
mSoundManager.addSound(28, R.raw.sound28);
mSoundManager.addSound(29, R.raw.sound29);
mSoundManager.addSound(30, R.raw.sound30);
Button SB = (Button)findViewById(R.id.sound1);
SB.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(1);
}
});
Button SB2 = (Button)findViewById(R.id.sound2);
SB2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(2);
}
});
Button SB3 = (Button)findViewById(R.id.sound3);
SB3.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(3);
}
});
Button SB4 = (Button)findViewById(R.id.sound4);
SB4.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(4);
}
});
Button SB5 = (Button)findViewById(R.id.sound5);
SB5.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(5);
}
});
Button btn = (Button) findViewById(R.id.sound1);
registerForContextMenu(btn);
Button btn2 = (Button) findViewById(R.id.sound2);
registerForContextMenu(btn2);
Button btn3 = (Button) findViewById(R.id.sound3);
registerForContextMenu(btn3);
Button btn4 = (Button) findViewById(R.id.sound4);
registerForContextMenu(btn4);
Button btn5 = (Button) findViewById(R.id.sound5);
registerForContextMenu(btn5);
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Save as...");
menu.add(0, v.getId(), 0, "Ringtone");
menu.add(0, v.getId(), 0, "Notification");
}
@Override
public boolean onContextItemSelected(MenuItem item) {
if(item.getTitle()=="Ringtone"){function1(item.getItemId());}
else if(item.getTitle()=="Notification"){function2(item.getItemId());}
else {return false;}
return true;
}
public void function1(int id){
if
(savering(R.raw.sound1)){
// Code if successful
Toast.makeText(this, "Saved as Ringtone", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
public void function2(int id){
if
(savenot(R.raw.sound1)){
// Code if successful
Toast.makeText(this, "Saved as Notification", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
//Save into Ring tone Folder
public boolean savering(int ressound){
byte[] buffer=null;
InputStream fIn = getBaseContext().getResources().openRawResource(ressound);
int size=50;
try {
size = fIn.available();
buffer = new byte[size];
fIn.read(buffer);
fIn.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path="/sdcard/media/audio/ringtones/";
String filename="sound1"+".ogg";
boolean exists = (new File(path)).exists();
if (!exists){new File(path).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path+filename);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "sound1 Ringtone");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
//Save in Notification Folder
public boolean savenot(int ressound){
byte[] buffer=null;
InputStream fIn = getBaseContext().getResources().openRawResource(ressound);
int size=0;
try {
size = fIn.available();
buffer = new byte[size];
fIn.read(buffer);
fIn.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path="/sdcard/media/audio/notifications/";
String filename="sound1"+".ogg";
boolean exists = (new File(path)).exists();
if (!exists){new File(path).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path+filename);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "sound1 Notification");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
//SOUND TWO/////////////////////////////////////////////////////
//SOUND TWO/////////////////////////////////////////////////////
//SOUND TWO/////////////////////////////////////////////////////
public void onCreateContextMenu1(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Save as...");
menu.add(1, v.getId(), 1, "Ringtone");
menu.add(1, v.getId(), 1, "Notification");
}
public boolean onContextItemSelected1(MenuItem item) {
if(item.getTitle()=="Ringtone"){function3(item.getItemId());}
else if(item.getTitle()=="Notification"){function4(item.getItemId());}
else {return false;}
return true;
}
public void function3(int id){
if
(savering(R.raw.sound2)){
// Code if successful
Toast.makeText(this, "Saved as Ringtone", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
public void function4(int id){
if
(savenot(R.raw.sound2)){
// Code if successful
Toast.makeText(this, "Saved as Notification", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
//Save into Ring tone Folder
public boolean savering2(int ressound2){
byte[] buffer=null;
InputStream fIn2 = getBaseContext().getResources().openRawResource(ressound2);
int size=50;
try {
size = fIn2.available();
buffer = new byte[size];
fIn2.read(buffer);
fIn2.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path2="/sdcard/media/audio/ringtones/";
String filename2="sound2"+".ogg";
boolean exists = (new File(path2)).exists();
if (!exists){new File(path2).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path2+filename2);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path2+filename2)));
File k = new File(path2, filename2);
ContentValues values2 = new ContentValues();
values2.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values2.put(MediaStore.MediaColumns.TITLE, "sound2 Ringtone");
values2.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values2.put(MediaStore.Audio.Media.ARTIST, "weee");
values2.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values2.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values2.put(MediaStore.Audio.Media.IS_ALARM, true);
values2.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values2);
return true;
}
//Save in Notification Folder
public boolean savenot2(int ressound2){
byte[] buffer=null;
InputStream fIn2 = getBaseContext().getResources().openRawResource(ressound2);
int size=0;
try {
size = fIn2.available();
buffer = new byte[size];
fIn2.read(buffer);
fIn2.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path2="/sdcard/media/audio/notifications/";
String filename2="sound2"+".ogg";
boolean exists = (new File(path2)).exists();
if (!exists){new File(path2).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path2+filename2);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path2+filename2)));
File kk = new File(path2, filename2);
ContentValues values2 = new ContentValues();
values2.put(MediaStore.MediaColumns.DATA, kk.getAbsolutePath());
values2.put(MediaStore.MediaColumns.TITLE, "sound2 Notification");
values2.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values2.put(MediaStore.Audio.Media.ARTIST, "weee");
values2.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values2.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values2.put(MediaStore.Audio.Media.IS_ALARM, true);
values2.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(kk.getAbsolutePath()), values2);
return true;
}
//SOUND THREE/////////////////////////////////////////////////////
| java | android | ringtone | null | null | 02/09/2011 01:11:59 | not a real question | how come this android/java code does not work?
===
Hey guys, ive been trying to repeat the code below to set ringtones from buttons (longclick), and the code below only saves the first buttons sound to the phone as notifcations or ringtone, and it wont save the other sounds, but still displays the menu as they were saved.
any clues? this is driving me crazy thanks.
package com.soundboard;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import com.soundboard.SoundManager;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class Soundboard extends Activity {
private SoundManager mSoundManager;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mSoundManager = new SoundManager();
mSoundManager.initSounds(getBaseContext());
mSoundManager.addSound(1, R.raw.sound1);
mSoundManager.addSound(2, R.raw.sound2);
mSoundManager.addSound(3, R.raw.sound3);
mSoundManager.addSound(4, R.raw.sound4);
mSoundManager.addSound(5, R.raw.sound5);
mSoundManager.addSound(6, R.raw.sound6);
mSoundManager.addSound(7, R.raw.sound7);
mSoundManager.addSound(8, R.raw.sound8);
mSoundManager.addSound(9, R.raw.sound9);
mSoundManager.addSound(10, R.raw.sound10);
mSoundManager.addSound(11, R.raw.sound11);
mSoundManager.addSound(12, R.raw.sound12);
mSoundManager.addSound(13, R.raw.sound13);
mSoundManager.addSound(14, R.raw.sound14);
mSoundManager.addSound(15, R.raw.sound15);
mSoundManager.addSound(16, R.raw.sound16);
mSoundManager.addSound(17, R.raw.sound17);
mSoundManager.addSound(18, R.raw.sound18);
mSoundManager.addSound(19, R.raw.sound19);
mSoundManager.addSound(20, R.raw.sound20);
mSoundManager.addSound(21, R.raw.sound21);
mSoundManager.addSound(22, R.raw.sound22);
mSoundManager.addSound(23, R.raw.sound23);
mSoundManager.addSound(24, R.raw.sound24);
mSoundManager.addSound(25, R.raw.sound25);
mSoundManager.addSound(26, R.raw.sound26);
mSoundManager.addSound(27, R.raw.sound27);
mSoundManager.addSound(28, R.raw.sound28);
mSoundManager.addSound(29, R.raw.sound29);
mSoundManager.addSound(30, R.raw.sound30);
Button SB = (Button)findViewById(R.id.sound1);
SB.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(1);
}
});
Button SB2 = (Button)findViewById(R.id.sound2);
SB2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(2);
}
});
Button SB3 = (Button)findViewById(R.id.sound3);
SB3.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(3);
}
});
Button SB4 = (Button)findViewById(R.id.sound4);
SB4.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(4);
}
});
Button SB5 = (Button)findViewById(R.id.sound5);
SB5.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mSoundManager.playSound(5);
}
});
Button btn = (Button) findViewById(R.id.sound1);
registerForContextMenu(btn);
Button btn2 = (Button) findViewById(R.id.sound2);
registerForContextMenu(btn2);
Button btn3 = (Button) findViewById(R.id.sound3);
registerForContextMenu(btn3);
Button btn4 = (Button) findViewById(R.id.sound4);
registerForContextMenu(btn4);
Button btn5 = (Button) findViewById(R.id.sound5);
registerForContextMenu(btn5);
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Save as...");
menu.add(0, v.getId(), 0, "Ringtone");
menu.add(0, v.getId(), 0, "Notification");
}
@Override
public boolean onContextItemSelected(MenuItem item) {
if(item.getTitle()=="Ringtone"){function1(item.getItemId());}
else if(item.getTitle()=="Notification"){function2(item.getItemId());}
else {return false;}
return true;
}
public void function1(int id){
if
(savering(R.raw.sound1)){
// Code if successful
Toast.makeText(this, "Saved as Ringtone", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
public void function2(int id){
if
(savenot(R.raw.sound1)){
// Code if successful
Toast.makeText(this, "Saved as Notification", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
//Save into Ring tone Folder
public boolean savering(int ressound){
byte[] buffer=null;
InputStream fIn = getBaseContext().getResources().openRawResource(ressound);
int size=50;
try {
size = fIn.available();
buffer = new byte[size];
fIn.read(buffer);
fIn.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path="/sdcard/media/audio/ringtones/";
String filename="sound1"+".ogg";
boolean exists = (new File(path)).exists();
if (!exists){new File(path).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path+filename);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "sound1 Ringtone");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
//Save in Notification Folder
public boolean savenot(int ressound){
byte[] buffer=null;
InputStream fIn = getBaseContext().getResources().openRawResource(ressound);
int size=0;
try {
size = fIn.available();
buffer = new byte[size];
fIn.read(buffer);
fIn.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path="/sdcard/media/audio/notifications/";
String filename="sound1"+".ogg";
boolean exists = (new File(path)).exists();
if (!exists){new File(path).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path+filename);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "sound1 Notification");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
//SOUND TWO/////////////////////////////////////////////////////
//SOUND TWO/////////////////////////////////////////////////////
//SOUND TWO/////////////////////////////////////////////////////
public void onCreateContextMenu1(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Save as...");
menu.add(1, v.getId(), 1, "Ringtone");
menu.add(1, v.getId(), 1, "Notification");
}
public boolean onContextItemSelected1(MenuItem item) {
if(item.getTitle()=="Ringtone"){function3(item.getItemId());}
else if(item.getTitle()=="Notification"){function4(item.getItemId());}
else {return false;}
return true;
}
public void function3(int id){
if
(savering(R.raw.sound2)){
// Code if successful
Toast.makeText(this, "Saved as Ringtone", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
public void function4(int id){
if
(savenot(R.raw.sound2)){
// Code if successful
Toast.makeText(this, "Saved as Notification", Toast.LENGTH_SHORT).show();
}
else
{
// Code if unsuccessful
Toast.makeText(this, "Failed - Check your SDCard", Toast.LENGTH_SHORT).show();
}
}
//Save into Ring tone Folder
public boolean savering2(int ressound2){
byte[] buffer=null;
InputStream fIn2 = getBaseContext().getResources().openRawResource(ressound2);
int size=50;
try {
size = fIn2.available();
buffer = new byte[size];
fIn2.read(buffer);
fIn2.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path2="/sdcard/media/audio/ringtones/";
String filename2="sound2"+".ogg";
boolean exists = (new File(path2)).exists();
if (!exists){new File(path2).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path2+filename2);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path2+filename2)));
File k = new File(path2, filename2);
ContentValues values2 = new ContentValues();
values2.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values2.put(MediaStore.MediaColumns.TITLE, "sound2 Ringtone");
values2.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values2.put(MediaStore.Audio.Media.ARTIST, "weee");
values2.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values2.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values2.put(MediaStore.Audio.Media.IS_ALARM, true);
values2.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values2);
return true;
}
//Save in Notification Folder
public boolean savenot2(int ressound2){
byte[] buffer=null;
InputStream fIn2 = getBaseContext().getResources().openRawResource(ressound2);
int size=0;
try {
size = fIn2.available();
buffer = new byte[size];
fIn2.read(buffer);
fIn2.close();
} catch (IOException e) {
// TODO Auto-generated catch block
return false; }
String path2="/sdcard/media/audio/notifications/";
String filename2="sound2"+".ogg";
boolean exists = (new File(path2)).exists();
if (!exists){new File(path2).mkdirs();}
FileOutputStream save;
try {
save = new FileOutputStream(path2+filename2);
save.write(buffer);
save.flush();
save.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
return false;
}
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path2+filename2)));
File kk = new File(path2, filename2);
ContentValues values2 = new ContentValues();
values2.put(MediaStore.MediaColumns.DATA, kk.getAbsolutePath());
values2.put(MediaStore.MediaColumns.TITLE, "sound2 Notification");
values2.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values2.put(MediaStore.Audio.Media.ARTIST, "weee");
values2.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values2.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values2.put(MediaStore.Audio.Media.IS_ALARM, true);
values2.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(kk.getAbsolutePath()), values2);
return true;
}
//SOUND THREE/////////////////////////////////////////////////////
| 1 |
4,826,070 | 01/28/2011 07:59:41 | 44,715 | 12/09/2008 19:24:19 | 1,509 | 133 | Selecting word in CBuilder | Lets take a codeline like:
MyApplication->Test();
In Visual Studio when I press Ctrl+Shift+Right, I can get "MyApplication" selected and the retype something to replace it.
In Embaracadero's CBuilder the selection gives me "MyApplication->", making me to add "->" after replacing the name.
Is there any editor setting that I have missed in IDE options or is it hardcoded in? | c++builder | null | null | null | null | null | open | Selecting word in CBuilder
===
Lets take a codeline like:
MyApplication->Test();
In Visual Studio when I press Ctrl+Shift+Right, I can get "MyApplication" selected and the retype something to replace it.
In Embaracadero's CBuilder the selection gives me "MyApplication->", making me to add "->" after replacing the name.
Is there any editor setting that I have missed in IDE options or is it hardcoded in? | 0 |
7,558,133 | 09/26/2011 16:24:38 | 774,296 | 05/28/2011 12:08:56 | 1 | 0 | What is Metro, is it going to replace .NET completely? | Heard that Microsoft is planning to release Metro (http://connect.microsoft.com/metro), calling next generation technologies and some of them said its going to replace .NET, is it true???
How Metro is important for a .NET developer?
| metro | null | null | null | null | 09/26/2011 17:41:14 | not a real question | What is Metro, is it going to replace .NET completely?
===
Heard that Microsoft is planning to release Metro (http://connect.microsoft.com/metro), calling next generation technologies and some of them said its going to replace .NET, is it true???
How Metro is important for a .NET developer?
| 1 |
3,013,526 | 06/10/2010 10:26:42 | 268,733 | 02/08/2010 15:01:49 | 896 | 6 | Is there an special Apple mailing list for every iPhone SDK framework? | I wonder how these Apple mailing lists work.
1) Is there one for every framework?
2) How to subscribe to them? | iphone | apple | null | null | null | null | open | Is there an special Apple mailing list for every iPhone SDK framework?
===
I wonder how these Apple mailing lists work.
1) Is there one for every framework?
2) How to subscribe to them? | 0 |
7,679,864 | 10/06/2011 20:06:31 | 559,596 | 01/01/2011 02:42:59 | 81 | 1 | How to access session from Warden/Devise after_authentication callback in Rails | I'm trying to access the current session from Warden's <a href="https://github.com/hassox/warden/wiki/Callbacks">after_authenticate</a> callback (running underneath Devise) in Rails 3.
At the top of my application controller I want to do something like:
Warden::Manager.after_authentication do |user,auth,opts|
user.associate_with_ids(session[:pending_ids])
end
The ultimate goal is to take a list of record IDs that were stored in the session before sign up and associate them with the user model after sign in.
Any help would be much appreciated. | ruby-on-rails | session | authentication | devise | warden | null | open | How to access session from Warden/Devise after_authentication callback in Rails
===
I'm trying to access the current session from Warden's <a href="https://github.com/hassox/warden/wiki/Callbacks">after_authenticate</a> callback (running underneath Devise) in Rails 3.
At the top of my application controller I want to do something like:
Warden::Manager.after_authentication do |user,auth,opts|
user.associate_with_ids(session[:pending_ids])
end
The ultimate goal is to take a list of record IDs that were stored in the session before sign up and associate them with the user model after sign in.
Any help would be much appreciated. | 0 |
11,477,890 | 07/13/2012 20:26:33 | 1,428,190 | 05/31/2012 10:46:05 | 7 | 0 | Cakephp Newsletter plugin | Anyone knows a cakephp plugin for sending multiple emails at one time?
I'm using CakePHP 2.0. and I would like to use a plugin like Swiftmailer to send newsletters.
Thanks in advance,
A.
| cakephp-2.0 | null | null | null | null | 07/16/2012 02:20:04 | not constructive | Cakephp Newsletter plugin
===
Anyone knows a cakephp plugin for sending multiple emails at one time?
I'm using CakePHP 2.0. and I would like to use a plugin like Swiftmailer to send newsletters.
Thanks in advance,
A.
| 4 |
8,992,699 | 01/24/2012 19:16:48 | 639,676 | 03/01/2011 16:05:27 | 55 | 1 | What is the best online solution to store and querying of geospatial data? | I need online service where I can put places or events and querying them by date periods, tags and do it with bounding box search. | geolocation | geospatial | geo | null | null | 01/24/2012 19:25:01 | off topic | What is the best online solution to store and querying of geospatial data?
===
I need online service where I can put places or events and querying them by date periods, tags and do it with bounding box search. | 2 |
11,041,993 | 06/14/2012 22:03:44 | 1,457,363 | 06/14/2012 21:40:57 | 1 | 0 | Extracting data according to a list | I'm trying to figure out how to extract some data from a string according to this list:
check_list = ['E1', 'E2', 'E7', 'E3', 'E9', 'E10', 'E12', 'IN1', 'IN2', 'IN4', 'IN10']
For example for this list:
s1 = "apto E1-E10 tower 1-2 sanit"
I would get ['E1', 'E10']
s2 = "apto IN2-IN1-IN4-E12-IN10 mamp"
For this i would get: ['IN2', 'IN1', 'IN4', 'E12', 'IN10']
And then this gets tricky:
s3 = "E-2-7-3-9-12; IN1-4-10 T 1-2 inst. hidr."
I would get: ['E2', 'E7', 'E3', 'E9', 'E12', 'IN1', 'IN4', 'IN10']
Can you please give some advice to solve this?
| python | regex | extract | null | null | null | open | Extracting data according to a list
===
I'm trying to figure out how to extract some data from a string according to this list:
check_list = ['E1', 'E2', 'E7', 'E3', 'E9', 'E10', 'E12', 'IN1', 'IN2', 'IN4', 'IN10']
For example for this list:
s1 = "apto E1-E10 tower 1-2 sanit"
I would get ['E1', 'E10']
s2 = "apto IN2-IN1-IN4-E12-IN10 mamp"
For this i would get: ['IN2', 'IN1', 'IN4', 'E12', 'IN10']
And then this gets tricky:
s3 = "E-2-7-3-9-12; IN1-4-10 T 1-2 inst. hidr."
I would get: ['E2', 'E7', 'E3', 'E9', 'E12', 'IN1', 'IN4', 'IN10']
Can you please give some advice to solve this?
| 0 |
6,873,852 | 07/29/2011 13:25:57 | 848,144 | 07/16/2011 20:53:51 | 1 | 1 | Three most useful things about python? | Which are 3 useful and interesting things about python to say to someone in order to convince them to try it out? | python | null | null | null | null | 07/29/2011 13:28:33 | not constructive | Three most useful things about python?
===
Which are 3 useful and interesting things about python to say to someone in order to convince them to try it out? | 4 |
6,448,903 | 06/23/2011 03:06:39 | 652,392 | 03/09/2011 20:50:08 | 57 | 13 | How to publish a wall post with 2 pictures | I'm creating a small app in which people compare diferent pictures of him and his friends.
The app is verry simple and I have no problem with it. The problem comes when users try to publish in their walls. I want the posts to be something like:
![enter image description here][1]
I know that by doing something like:
$parameters = array('message' => 'this is my message',
'name' => 'Name of the app',
'caption' => "Caption of the Post",
'link' => 'http://www.link.com',
'description' => 'description',
'picture' => 'http://mysite.com/pic.gif');
$result = $facebook->api('/user_id/feed/', 'post', $parameters );
You can post on a wall, but that limits the app to one picture only and I want the users to be able to post two diferent picures.
Is here a way to publish a post like the one in the image?
Thank you in advance.
[1]: http://i.stack.imgur.com/NKvBP.png | facebook | null | null | null | null | null | open | How to publish a wall post with 2 pictures
===
I'm creating a small app in which people compare diferent pictures of him and his friends.
The app is verry simple and I have no problem with it. The problem comes when users try to publish in their walls. I want the posts to be something like:
![enter image description here][1]
I know that by doing something like:
$parameters = array('message' => 'this is my message',
'name' => 'Name of the app',
'caption' => "Caption of the Post",
'link' => 'http://www.link.com',
'description' => 'description',
'picture' => 'http://mysite.com/pic.gif');
$result = $facebook->api('/user_id/feed/', 'post', $parameters );
You can post on a wall, but that limits the app to one picture only and I want the users to be able to post two diferent picures.
Is here a way to publish a post like the one in the image?
Thank you in advance.
[1]: http://i.stack.imgur.com/NKvBP.png | 0 |
11,026,093 | 06/14/2012 03:02:04 | 1,154,499 | 01/17/2012 17:19:16 | 14 | 0 | Radio buttons dont work when jquery.html() is used to load dynamic form | [http://ano-mag.com/black-foil/][1] please check this url - click the "Order Now" button on the left side - notice how the radio buttons won't work? I cant figure it out!
[1]: http://ano-mag.com/black-foil/ | jquery | html | forms | radio | null | null | open | Radio buttons dont work when jquery.html() is used to load dynamic form
===
[http://ano-mag.com/black-foil/][1] please check this url - click the "Order Now" button on the left side - notice how the radio buttons won't work? I cant figure it out!
[1]: http://ano-mag.com/black-foil/ | 0 |
9,492,454 | 02/29/2012 01:42:15 | 1,239,184 | 02/29/2012 01:37:02 | 1 | 0 | In Ubuntu, Check for existence of file, then... (not server) | I need a script that will load something only if a file exists. want to hide this program if it's not installed, Pidgin. I have this right now to show the file;
let icon = new St.Icon({icon_name: "pidgin", icon_size: ICON_SIZE, icon_type: St.IconType.FULLCOLOR});
this.filesystemItem = new MyPopupMenuItem(icon, _("Chat"));
this.menu.addMenuItem(this.filesystemItem);
this.filesystemItem.connect('activate', function(actor, event) {
Main.Util.spawnCommandLine("pidgin");
});
I need that only to load if the file: /usr/share/applications/Pidgin Internet Messenger.desktop is present. Please and thank you. | linux | null | null | null | null | null | open | In Ubuntu, Check for existence of file, then... (not server)
===
I need a script that will load something only if a file exists. want to hide this program if it's not installed, Pidgin. I have this right now to show the file;
let icon = new St.Icon({icon_name: "pidgin", icon_size: ICON_SIZE, icon_type: St.IconType.FULLCOLOR});
this.filesystemItem = new MyPopupMenuItem(icon, _("Chat"));
this.menu.addMenuItem(this.filesystemItem);
this.filesystemItem.connect('activate', function(actor, event) {
Main.Util.spawnCommandLine("pidgin");
});
I need that only to load if the file: /usr/share/applications/Pidgin Internet Messenger.desktop is present. Please and thank you. | 0 |
11,569,348 | 07/19/2012 21:09:04 | 1,539,114 | 07/19/2012 20:56:39 | 1 | 0 | Arduino motor control | I am working on a project where I have to control a vehicle barrier gate (like [this][1]). Our team has planned to work with Arduino but we are open to other suggestions.
My question is, can I use a DC motor for this sort of task or should I look into AC motors? And what kind of motor should I use? Is this even possible using Arduino?
I looked into some of the tutorials of automated garage door openers which kind of relates to what I am trying to do. But the problem is, most of them use commercial garage door openers which are already built in to the system. So I have no way to know which hardware (specifically, which motor) they used for the purpose.
I have worked with Arduino before so have some idea on how it operates.
Any help will be appreciated.
(If this is not the appropriate place to post this question, please let me know).
Thanks a lot!
[1]: http://www.laornamental.com/images/Liftmaster-MegaArm-Tower-Barrier-Gate-Operators-small.jpg | hardware | arduino | null | null | null | 07/20/2012 15:14:10 | off topic | Arduino motor control
===
I am working on a project where I have to control a vehicle barrier gate (like [this][1]). Our team has planned to work with Arduino but we are open to other suggestions.
My question is, can I use a DC motor for this sort of task or should I look into AC motors? And what kind of motor should I use? Is this even possible using Arduino?
I looked into some of the tutorials of automated garage door openers which kind of relates to what I am trying to do. But the problem is, most of them use commercial garage door openers which are already built in to the system. So I have no way to know which hardware (specifically, which motor) they used for the purpose.
I have worked with Arduino before so have some idea on how it operates.
Any help will be appreciated.
(If this is not the appropriate place to post this question, please let me know).
Thanks a lot!
[1]: http://www.laornamental.com/images/Liftmaster-MegaArm-Tower-Barrier-Gate-Operators-small.jpg | 2 |
9,237,597 | 02/11/2012 03:32:32 | 825,757 | 07/02/2011 04:22:41 | 559 | 23 | Robots.TXT and Meta Tag Robots | I want to make sure I understand this:
This: `<meta content="noindex, nofollow" name="robots" />` in the `<head>` of a webpage
is the same as:
`Disallow: /example-page.html` in the `Robots.txt`
Right? | meta-tags | robots.txt | null | null | null | 06/05/2012 19:40:11 | off topic | Robots.TXT and Meta Tag Robots
===
I want to make sure I understand this:
This: `<meta content="noindex, nofollow" name="robots" />` in the `<head>` of a webpage
is the same as:
`Disallow: /example-page.html` in the `Robots.txt`
Right? | 2 |
6,630,946 | 07/08/2011 21:54:14 | 18,255 | 09/18/2008 21:09:06 | 32,701 | 1,711 | Default CultureInfo.NumberFormat.NumberGroupSeparator for Poland is "space"? | Our Polish users didn't seem to use that convention as far as I can see on some materials I have. I was under the impression that most of our continental European users (da-dk, pl-pl, nl-nl) would be formatting N.NNN.NNN,NN and our British Isles users (en-gb, en-ie) would be formatting N,NNN,NNN.NN.
But the reports in our tests for the Polish users started coming out with spaces, and it looked odd to me, and this seems to be due to a space in CultureInfo.NumberFormat.NumberGroupSeparator, and I don't think we put it there.
Any Poles out there want to comment on this convention? | localization | internationalization | numberformat | null | null | null | open | Default CultureInfo.NumberFormat.NumberGroupSeparator for Poland is "space"?
===
Our Polish users didn't seem to use that convention as far as I can see on some materials I have. I was under the impression that most of our continental European users (da-dk, pl-pl, nl-nl) would be formatting N.NNN.NNN,NN and our British Isles users (en-gb, en-ie) would be formatting N,NNN,NNN.NN.
But the reports in our tests for the Polish users started coming out with spaces, and it looked odd to me, and this seems to be due to a space in CultureInfo.NumberFormat.NumberGroupSeparator, and I don't think we put it there.
Any Poles out there want to comment on this convention? | 0 |
7,274,798 | 09/01/2011 18:31:19 | 798,042 | 06/14/2011 16:06:41 | 43 | 1 | How to get ASIN and price from AMAZON | I have the detail information of books including ISBN, title, and author, is there anyway to get ASIN and the price so that i could make links to the product page on amazon directly?Thanks. | php | amazon-web-services | null | null | null | null | open | How to get ASIN and price from AMAZON
===
I have the detail information of books including ISBN, title, and author, is there anyway to get ASIN and the price so that i could make links to the product page on amazon directly?Thanks. | 0 |
5,656,311 | 04/13/2011 22:13:27 | 654,060 | 03/10/2011 18:03:19 | 1 | 0 | I want to learn a new programming language | I know some Visual FoxPro and I was doing everything with code, I wasn't using the IDE and I also know a little PHP. Since Visual FoxPro is no longer supported by Microsoft I want to learn a new language for development of windows applications that can be learnt in a couple of months and does not need expensive software to develop in. I hope I made myself understood as I am not a native English speaker. | windows | null | null | null | null | 04/13/2011 22:16:16 | off topic | I want to learn a new programming language
===
I know some Visual FoxPro and I was doing everything with code, I wasn't using the IDE and I also know a little PHP. Since Visual FoxPro is no longer supported by Microsoft I want to learn a new language for development of windows applications that can be learnt in a couple of months and does not need expensive software to develop in. I hope I made myself understood as I am not a native English speaker. | 2 |
11,469,093 | 07/13/2012 10:55:30 | 1,504,434 | 07/05/2012 15:10:09 | 1 | 0 | Wordpress auth in external PHP | Is it possible to protect an external php script on the same server as a wordpress install, with the wordpress login system?
I've found no decent info online.
Thanks. | php | wordpress | authentication | null | null | 07/13/2012 23:57:05 | off topic | Wordpress auth in external PHP
===
Is it possible to protect an external php script on the same server as a wordpress install, with the wordpress login system?
I've found no decent info online.
Thanks. | 2 |
11,524,052 | 07/17/2012 13:56:28 | 1,516,954 | 07/11/2012 07:12:39 | 27 | 0 | Auto Map reference not found C# |
here is my code:
while (rdr.Read())
{
List<PackageDetailFile> pkgFiles = rdr.AutoMap <PackageDetailFile> ().ToList();
foreach (PackageDetailFile pkgf in pkgFiles)
{
PackageDetail pkgd = getPackageDetail((long)pkgf.PackageDetailId);
}
i have an error like: 'System.Data.SqlClient.SqlDataReader' does not contain a definition for 'AutoMap' and no extension method 'AutoMap' accepting a first argument of type 'System.Data.SqlClient.SqlDataReader' could be found (are you missing a using directive or an assembly reference?)
and i couldnt find the AutoMap reference. | c# | list | reader | automap | null | 07/19/2012 01:53:02 | not a real question | Auto Map reference not found C#
===
here is my code:
while (rdr.Read())
{
List<PackageDetailFile> pkgFiles = rdr.AutoMap <PackageDetailFile> ().ToList();
foreach (PackageDetailFile pkgf in pkgFiles)
{
PackageDetail pkgd = getPackageDetail((long)pkgf.PackageDetailId);
}
i have an error like: 'System.Data.SqlClient.SqlDataReader' does not contain a definition for 'AutoMap' and no extension method 'AutoMap' accepting a first argument of type 'System.Data.SqlClient.SqlDataReader' could be found (are you missing a using directive or an assembly reference?)
and i couldnt find the AutoMap reference. | 1 |
6,117,765 | 05/24/2011 22:42:25 | 768,629 | 05/24/2011 22:42:26 | 1 | 0 | ubuntu /var file full and do not have read permissions | I seem to have hosed myself, as I was running/learning some failing PHP/MySQL data scrape script and went off to bed. I don't know if it looped or what exactly happened, but I came back and it showed disk almost full. The analyzer said I had used almost 100G of a 100G drive on a /var directory. I try du and df-ah, but it will not show where the hog is. Says, "Permission denied." for many of the directories.
Clues:
1) gdm directory is listed as recent but won't let me look inside.
2) I was running an edit program called gksudo gedit, because I could not write to /var/www files for PHP. It appears that in the ps window, a nautilus program is dormant.
Any help is greatly appreciated and I love ubuntu, but I'm pretty much a linux newbie.
Thanks.
| ubuntu-10.04 | null | null | null | null | 05/25/2011 17:05:19 | off topic | ubuntu /var file full and do not have read permissions
===
I seem to have hosed myself, as I was running/learning some failing PHP/MySQL data scrape script and went off to bed. I don't know if it looped or what exactly happened, but I came back and it showed disk almost full. The analyzer said I had used almost 100G of a 100G drive on a /var directory. I try du and df-ah, but it will not show where the hog is. Says, "Permission denied." for many of the directories.
Clues:
1) gdm directory is listed as recent but won't let me look inside.
2) I was running an edit program called gksudo gedit, because I could not write to /var/www files for PHP. It appears that in the ps window, a nautilus program is dormant.
Any help is greatly appreciated and I love ubuntu, but I'm pretty much a linux newbie.
Thanks.
| 2 |
9,486,894 | 02/28/2012 17:35:31 | 700,338 | 04/09/2011 21:25:34 | 303 | 17 | Get "real" date and time | I was wondering if anyone knew of a simple way to get the date and time from an outside source that is not the iPhone the program is running on. Basically, in my application there is going to be a time sensitive portion that users can not start until after a certain time. But if I go and grab the date and time from the device, the user can easily change the date and time on their device, bypassing the time sensitive portion.
Any suggestions on stopping this from happening, or does anyone know of an already existing API that I can call that will simply return the time and date. | iphone | ios | api | time | nsdate | 02/28/2012 18:03:37 | too localized | Get "real" date and time
===
I was wondering if anyone knew of a simple way to get the date and time from an outside source that is not the iPhone the program is running on. Basically, in my application there is going to be a time sensitive portion that users can not start until after a certain time. But if I go and grab the date and time from the device, the user can easily change the date and time on their device, bypassing the time sensitive portion.
Any suggestions on stopping this from happening, or does anyone know of an already existing API that I can call that will simply return the time and date. | 3 |
5,063,614 | 02/21/2011 08:09:36 | 264,250 | 02/02/2010 10:56:26 | 723 | 14 | How to use shared libraries in my development environment? | I am working on a project with several modules. The development tree looks like:
/work_home/src/...
/work_home/out/bin/ <Here all the executables are built to>
/work_home/out/foo1/lib/ <one .so is built here>
/work_home/out/foo2/lib/ <another .so is built here>
...
/work_home/out/foo42/lib/ <another .so is built here>
Now, the following question only applies to when i am running an executable which uses the shared libraries in my development environment - as opposed to when we actually deploy our package on our customer's system.
What would be the best way to ensure that when i run an executable it can load a shared library?
| linux | development-environment | shared-libraries | null | null | null | open | How to use shared libraries in my development environment?
===
I am working on a project with several modules. The development tree looks like:
/work_home/src/...
/work_home/out/bin/ <Here all the executables are built to>
/work_home/out/foo1/lib/ <one .so is built here>
/work_home/out/foo2/lib/ <another .so is built here>
...
/work_home/out/foo42/lib/ <another .so is built here>
Now, the following question only applies to when i am running an executable which uses the shared libraries in my development environment - as opposed to when we actually deploy our package on our customer's system.
What would be the best way to ensure that when i run an executable it can load a shared library?
| 0 |
7,429,851 | 09/15/2011 11:13:26 | 872,134 | 07/21/2011 05:01:27 | 80 | 3 | Why android mobile is not running my appliation? | i am trying to run a simple program `hello world` in my android mobile.
but the application stops unexpectedly.
the `apk` file is installing easily but it is not running.
i do not understand why this happens | android | null | null | null | null | 09/15/2011 12:27:32 | not a real question | Why android mobile is not running my appliation?
===
i am trying to run a simple program `hello world` in my android mobile.
but the application stops unexpectedly.
the `apk` file is installing easily but it is not running.
i do not understand why this happens | 1 |
4,273,328 | 11/25/2010 02:46:00 | 288,462 | 03/08/2010 02:18:49 | 139 | 0 | Is there any memory virtual file API in Windows? | I have a module load a file by its path,
However I find it is slow.
I want to accelerate it,
Is there any technology in Windows to create a virtual memory file for the module?
Many thanks | c++ | windows | file | memory | virtual | null | open | Is there any memory virtual file API in Windows?
===
I have a module load a file by its path,
However I find it is slow.
I want to accelerate it,
Is there any technology in Windows to create a virtual memory file for the module?
Many thanks | 0 |
6,774,634 | 07/21/2011 10:28:17 | 115,139 | 05/31/2009 16:08:03 | 942 | 52 | Ho do I solve the "Cannot perform this operation on a closed dataset" with Borland Database Engine and a Delphi application? | The application was working perfectly, until I edited the user database (*.dbf) in OpenOffice.org Calc. Now it gives me the above error about a closed dataset. | delphi | dataset | bde | null | null | 07/22/2011 01:47:19 | not a real question | Ho do I solve the "Cannot perform this operation on a closed dataset" with Borland Database Engine and a Delphi application?
===
The application was working perfectly, until I edited the user database (*.dbf) in OpenOffice.org Calc. Now it gives me the above error about a closed dataset. | 1 |
9,227,657 | 02/10/2012 12:18:34 | 1,061,703 | 11/23/2011 10:39:24 | 31 | 1 | Java String length more than characters in it | I had two questions,
1) In Spring MVC application, what is the purpose of having ContextLoaderListener?
2) Below are the my entries in web.xml,
All MVC beans are defined in servlet-context.xml
All database and annotation based transaction management is defined in applicationContext.xml and I'm using container managed transaction in JBoss
The trasaction manager works fine if I keep the applicationContext.xml as higlighted in below as <init-param> to DispatcherServlet. But I thought we should only pass the Spring MVC context info to DispatcherServlet and if I remove the applicationContext.xml the transaction manager stops working? I'm confused what is best way of managing the context files?
*Web.xml*
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/applicationContext.xml
/WEB-INF/config/spring-mail.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>messages</param-value>
</context-param>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/servlet-context.xml
/WEB-INF/config/applicationContext.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
*applicationContext.xml*
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- registers all of Spring's standard post-processors for annotation-based configuration -->
<context:annotation-config />
<jee:jndi-lookup id="dataSource" jndi-name="java:OracleDS"/>
<tx:annotation-driven/>
<tx:jta-transaction-manager/>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation"
value="classpath:com/common/model/config/sqlmapconfig.xml"/>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory"/>
</bean>
</beans>
Thanks for you help! | spring-mvc | null | null | null | null | null | open | Java String length more than characters in it
===
I had two questions,
1) In Spring MVC application, what is the purpose of having ContextLoaderListener?
2) Below are the my entries in web.xml,
All MVC beans are defined in servlet-context.xml
All database and annotation based transaction management is defined in applicationContext.xml and I'm using container managed transaction in JBoss
The trasaction manager works fine if I keep the applicationContext.xml as higlighted in below as <init-param> to DispatcherServlet. But I thought we should only pass the Spring MVC context info to DispatcherServlet and if I remove the applicationContext.xml the transaction manager stops working? I'm confused what is best way of managing the context files?
*Web.xml*
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/applicationContext.xml
/WEB-INF/config/spring-mail.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>messages</param-value>
</context-param>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/servlet-context.xml
/WEB-INF/config/applicationContext.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
*applicationContext.xml*
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- registers all of Spring's standard post-processors for annotation-based configuration -->
<context:annotation-config />
<jee:jndi-lookup id="dataSource" jndi-name="java:OracleDS"/>
<tx:annotation-driven/>
<tx:jta-transaction-manager/>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation"
value="classpath:com/common/model/config/sqlmapconfig.xml"/>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory"/>
</bean>
</beans>
Thanks for you help! | 0 |
3,335,735 | 07/26/2010 14:23:05 | 147,453 | 07/29/2009 21:58:55 | 218 | 15 | Resolving automatic and manual dependencies | I´m having a little bit of trouble sorting a way to manage automatic resolved and manual dependencies in my classes.
Let´s say I have two classes to calculate prices: one calculates how much I will charge for shipping and the other how much I will charge for the entire order. The second uses the first in order to sum the shipping price to the entire order price.
Both classes have a dependency to a third class that I will call ExchangeRate which gives me the exchange rate I should use for price calculation.
So far we have this chain of dependency:
OrderCalculator -> ShippingCalculator -> ExchangeRate
I´m using Ninject to resolve these dependencies and this was working until now. Now I have a requirement that the rate returned by ExchangeRate class will vary upon a parameter that will be provided in the Constructor (because the object won´t work without this, so to make the dependency explicit it´s placed on the constructor) coming from a user input. Because of that I can no longer resolve my dependencies automatically.
Whenever I want to the OrderCalculator or any other classes that depends on ExchangeRate I cannot ask the Ninject container to resolve it to me since I need to provide the parameter in the constructor.
What do u suggest in this case?
Thanks! | c# | dependency-injection | inversion-of-control | ninject | null | null | open | Resolving automatic and manual dependencies
===
I´m having a little bit of trouble sorting a way to manage automatic resolved and manual dependencies in my classes.
Let´s say I have two classes to calculate prices: one calculates how much I will charge for shipping and the other how much I will charge for the entire order. The second uses the first in order to sum the shipping price to the entire order price.
Both classes have a dependency to a third class that I will call ExchangeRate which gives me the exchange rate I should use for price calculation.
So far we have this chain of dependency:
OrderCalculator -> ShippingCalculator -> ExchangeRate
I´m using Ninject to resolve these dependencies and this was working until now. Now I have a requirement that the rate returned by ExchangeRate class will vary upon a parameter that will be provided in the Constructor (because the object won´t work without this, so to make the dependency explicit it´s placed on the constructor) coming from a user input. Because of that I can no longer resolve my dependencies automatically.
Whenever I want to the OrderCalculator or any other classes that depends on ExchangeRate I cannot ask the Ninject container to resolve it to me since I need to provide the parameter in the constructor.
What do u suggest in this case?
Thanks! | 0 |
4,332,512 | 12/02/2010 07:04:20 | 298,336 | 03/21/2010 07:16:45 | 439 | 7 | Change code in production without deployment - ASP.NET | I am using asp.net
In my .cs page I am setting a value for a variable [count = 12]. count is a var, which I have declared on the aspx page.
Now I have to change the vlaue of the count = 13. which should be written in the !IspostBack event in the Page_Load(). But the issue is this that it's a very small change and I can't re deploy my website for this small change.
Is their any way I can modify the code in the production site whitout re deploying it? | asp.net | asp.net-2.0 | null | null | null | null | open | Change code in production without deployment - ASP.NET
===
I am using asp.net
In my .cs page I am setting a value for a variable [count = 12]. count is a var, which I have declared on the aspx page.
Now I have to change the vlaue of the count = 13. which should be written in the !IspostBack event in the Page_Load(). But the issue is this that it's a very small change and I can't re deploy my website for this small change.
Is their any way I can modify the code in the production site whitout re deploying it? | 0 |
10,118,077 | 04/12/2012 05:50:14 | 1,188,892 | 02/04/2012 04:47:12 | 1 | 0 | SQL Auto Random Details Filling | A table in my mysql database contains 9 fields, i want 2 fields to be blank
I want a sql command or something to fill the fields. The first field is id, it's serial number given. The command should get the last id and fill this field with new id.
username field:- it should contain random name, can use random name generator api
password:- random string
email:- random with correct format
points- random (10-800 limit )
star:- random (0-100)
That's it what can i use for it please help | mysql | sql | database | null | null | 04/16/2012 19:58:19 | not a real question | SQL Auto Random Details Filling
===
A table in my mysql database contains 9 fields, i want 2 fields to be blank
I want a sql command or something to fill the fields. The first field is id, it's serial number given. The command should get the last id and fill this field with new id.
username field:- it should contain random name, can use random name generator api
password:- random string
email:- random with correct format
points- random (10-800 limit )
star:- random (0-100)
That's it what can i use for it please help | 1 |
11,301,003 | 07/02/2012 20:52:35 | 73,951 | 03/04/2009 21:54:03 | 1,116 | 73 | Is it necessary to append querystrings to images in an img tag and images in css to refresh cached items? | I know that a common practice is to set an expire time far in the future for css, javascript and image files and then make sure that all browsers fetches the latest content as soon the files changes by appending a querystring (or changing filename) like this
From this `<link rel="stylesheet" type="text/css" href="base.css">`:
to this:
<link rel="stylesheet" type="text/css" href="base.css?v=1234">
or:
<link rel="stylesheet" type="text/css" href="base_1234.css">
But what about images referenced in a css file?
// Inside base.css
background: url(/img/logo.png)
// Is this necessary(?):
background: url(/img/logo.png?v=1234)
Or will `/img/logo.png` be reloaded when base.css changes filename to `base.css?v=1234` or `base_1234.css` automatically?
And also, what about images in `src` for `img`-tags? | http | http-caching | expire | null | null | null | open | Is it necessary to append querystrings to images in an img tag and images in css to refresh cached items?
===
I know that a common practice is to set an expire time far in the future for css, javascript and image files and then make sure that all browsers fetches the latest content as soon the files changes by appending a querystring (or changing filename) like this
From this `<link rel="stylesheet" type="text/css" href="base.css">`:
to this:
<link rel="stylesheet" type="text/css" href="base.css?v=1234">
or:
<link rel="stylesheet" type="text/css" href="base_1234.css">
But what about images referenced in a css file?
// Inside base.css
background: url(/img/logo.png)
// Is this necessary(?):
background: url(/img/logo.png?v=1234)
Or will `/img/logo.png` be reloaded when base.css changes filename to `base.css?v=1234` or `base_1234.css` automatically?
And also, what about images in `src` for `img`-tags? | 0 |
2,513,902 | 03/25/2010 08:17:21 | 234,404 | 12/18/2009 08:50:33 | 50 | 0 | validate a .edu or .ac email address | I'm a noob but trying vigorously to simply validate email addresses that only end in ".edu" or ".ac" is there a simple function/script/solution to this seemingly simple problem? able to use php,javascript or jquery.
Any help would be great thanks in advance! | validate | null | null | null | null | null | open | validate a .edu or .ac email address
===
I'm a noob but trying vigorously to simply validate email addresses that only end in ".edu" or ".ac" is there a simple function/script/solution to this seemingly simple problem? able to use php,javascript or jquery.
Any help would be great thanks in advance! | 0 |
6,456,757 | 06/23/2011 15:37:26 | 798,208 | 06/14/2011 17:47:44 | 116 | 7 | Interop.SHDocVw Navigate2() method displays unwanted download box | I am writing some regression tests in WatiN and needed to make a couple POST web requests. The requests are working fine but I get an annoying dialog box asking me if I want to save the file or find a program online to open it. The line of code that is causing this is:
browser.Navigate2(ref uri, ref nflags, ref ntargetFrame,
ref dataBytes, ref headers);
Is anyone familiar with the Navigate2() method? Any idea on how to get rid of this download box? | watin | shdocvw | post-request | null | null | null | open | Interop.SHDocVw Navigate2() method displays unwanted download box
===
I am writing some regression tests in WatiN and needed to make a couple POST web requests. The requests are working fine but I get an annoying dialog box asking me if I want to save the file or find a program online to open it. The line of code that is causing this is:
browser.Navigate2(ref uri, ref nflags, ref ntargetFrame,
ref dataBytes, ref headers);
Is anyone familiar with the Navigate2() method? Any idea on how to get rid of this download box? | 0 |
8,867,397 | 01/15/2012 03:47:21 | 613,858 | 02/12/2011 02:10:25 | 114 | 15 | Best way to save values selected in UIPicker? | I have 3 UIPickers in my view, I would like to save the selected values for when my app closes. Im currently using NSUserDefaults for everything else. But I wasn't sure of the syntax for save selected values of UIPickers. Thanks my fellow coders! | iphone | ios | xcode | save | uipicker | null | open | Best way to save values selected in UIPicker?
===
I have 3 UIPickers in my view, I would like to save the selected values for when my app closes. Im currently using NSUserDefaults for everything else. But I wasn't sure of the syntax for save selected values of UIPickers. Thanks my fellow coders! | 0 |
5,018,502 | 02/16/2011 15:42:29 | 313,827 | 04/11/2010 09:10:22 | 60 | 1 | Flexible graph visualization framework for Javascript | I'm looking for a flexible graph visualisation framework for Javascript similar to the flex component [SpringGraph][1]. I need to be able to represent nodes to be different visual components e.g. be a window, image etc. be able to name edges etc. Any recommendations?
[1]: http://mark-shepherd.com/blog/springgraph-flex-component/ | javascript | flex | graph | visualization | null | 02/06/2012 23:53:01 | not constructive | Flexible graph visualization framework for Javascript
===
I'm looking for a flexible graph visualisation framework for Javascript similar to the flex component [SpringGraph][1]. I need to be able to represent nodes to be different visual components e.g. be a window, image etc. be able to name edges etc. Any recommendations?
[1]: http://mark-shepherd.com/blog/springgraph-flex-component/ | 4 |
6,219,050 | 06/02/2011 18:58:09 | 781,697 | 06/02/2011 18:58:09 | 1 | 0 | C program with files | so i making a program about a store where you have a menu and you choose an option .
im stack in the sales option where i am supposed to make a pipe , parent , server , where the user will type in the code of TV(for example) and the quantity (parent will read that) and will write it in pipe and child will read it , and SEARCH in the file if the code is correct and if there are enough TV's and then we subtract the total of tvs so we have to update the file
for example the order is 2 TV's , we search in the file , there are 10 TV's so its ok to proceed with the order , 10-2 = 8 TV's now in the file ( update FILe so next time will show 8 tv)
. (im using C language , i know pipes are used in UNIX , im executing this on a LINUX server of my university ) .
the file that the child is supposed to search into , its created earlier from the user , its not ready . everything work , except this .
here is a part of my code
polisi()//anigi arxio proionton ke elegxi diathesimotita proiontos
{
pid_t pid;
int mypipe[2];
/* dimiourgia solinas */
if (pipe (mypipe))
{
fprintf (stderr, "Pipe failed.\n");
return EXIT_FAILURE;
}
/* dimiourgia diergasias pedi */
pid = fork ();
if (pid == (pid_t) 0)
{
/* diergasia pedi , kali tin anagnosi_apo_pipe */
anagnosi_apo_pipe (mypipe[0]);
return EXIT_SUCCESS;
}
else if (pid < (pid_t) 0)
{
/* fork failed. */
fprintf (stderr, "Fork failed.\n");
return EXIT_FAILURE;
}
else
{
/* diergasia gonios */
grapse_stin_pipe (mypipe[1]);
return EXIT_SUCCESS;
}
void
read_from_pipe (int file)
char kodikos_paraggelias[80];
int posotita_paraggelias;
fp = fdopen (file, "w");
fprintf (fp, "dose kodiko proiontos : \n");
scanf("%s",kodikos_paraggelias);
fprintf (fp, "dose posotita proiontos : \n");
//fprintf (stream, "dose email pelati :\n");
scanf("%d",&posotita_paraggelias);
fclose (fp);
void
write_to_pipe (int file)
fp = fdopen ("proionta.txt", "r");
if (fp==NULL) perror ("Error opening file");
else {
do
{ kodikos = fgets (fp);
posotita = fgetc (fp);
if (kodikos == kodikos_paraggelias) && (posotita = posotita_paraggelias)
{fprintf(fp, "to proion ine diathesimo");
posotita = posotita - posotita_paraggelias;
fclose (fp);
}
}
}
NOTE : please if someone dont want to help dont reply with stupid answer like " do it yourself " or anything like that . ( im reading a lot of answers like that with other questions)
Thanks in advance | c | file | pipes | null | null | 06/02/2011 22:29:26 | too localized | C program with files
===
so i making a program about a store where you have a menu and you choose an option .
im stack in the sales option where i am supposed to make a pipe , parent , server , where the user will type in the code of TV(for example) and the quantity (parent will read that) and will write it in pipe and child will read it , and SEARCH in the file if the code is correct and if there are enough TV's and then we subtract the total of tvs so we have to update the file
for example the order is 2 TV's , we search in the file , there are 10 TV's so its ok to proceed with the order , 10-2 = 8 TV's now in the file ( update FILe so next time will show 8 tv)
. (im using C language , i know pipes are used in UNIX , im executing this on a LINUX server of my university ) .
the file that the child is supposed to search into , its created earlier from the user , its not ready . everything work , except this .
here is a part of my code
polisi()//anigi arxio proionton ke elegxi diathesimotita proiontos
{
pid_t pid;
int mypipe[2];
/* dimiourgia solinas */
if (pipe (mypipe))
{
fprintf (stderr, "Pipe failed.\n");
return EXIT_FAILURE;
}
/* dimiourgia diergasias pedi */
pid = fork ();
if (pid == (pid_t) 0)
{
/* diergasia pedi , kali tin anagnosi_apo_pipe */
anagnosi_apo_pipe (mypipe[0]);
return EXIT_SUCCESS;
}
else if (pid < (pid_t) 0)
{
/* fork failed. */
fprintf (stderr, "Fork failed.\n");
return EXIT_FAILURE;
}
else
{
/* diergasia gonios */
grapse_stin_pipe (mypipe[1]);
return EXIT_SUCCESS;
}
void
read_from_pipe (int file)
char kodikos_paraggelias[80];
int posotita_paraggelias;
fp = fdopen (file, "w");
fprintf (fp, "dose kodiko proiontos : \n");
scanf("%s",kodikos_paraggelias);
fprintf (fp, "dose posotita proiontos : \n");
//fprintf (stream, "dose email pelati :\n");
scanf("%d",&posotita_paraggelias);
fclose (fp);
void
write_to_pipe (int file)
fp = fdopen ("proionta.txt", "r");
if (fp==NULL) perror ("Error opening file");
else {
do
{ kodikos = fgets (fp);
posotita = fgetc (fp);
if (kodikos == kodikos_paraggelias) && (posotita = posotita_paraggelias)
{fprintf(fp, "to proion ine diathesimo");
posotita = posotita - posotita_paraggelias;
fclose (fp);
}
}
}
NOTE : please if someone dont want to help dont reply with stupid answer like " do it yourself " or anything like that . ( im reading a lot of answers like that with other questions)
Thanks in advance | 3 |
11,461,247 | 07/12/2012 21:50:21 | 455,119 | 09/22/2010 14:09:55 | 381 | 22 | Facebook app font face loading and then disappearing in IE7-8 | I’ve had an odd error come through on my latest project. It hasn’t launched so I can’t share, but here are some details:
• Facebook page
• Issue seems to be in IE7-8 only
• Using custom @fontface fonts
• Cannot reproduce issue on VirtualBox
The issue is that the fonts load fine when the page loads originally in IE7-8, when the user goes to an interior page all @fontface fonts revert to their web-safe font backups. They will stay that way (even returning to the first page that had the fonts loaded) until the cache is cleared. The fonts load & stay loaded on the same test machine in Chrome & Foxy.
Anyone have any ideas? | html | css | facebook | internet-explorer | fonts | null | open | Facebook app font face loading and then disappearing in IE7-8
===
I’ve had an odd error come through on my latest project. It hasn’t launched so I can’t share, but here are some details:
• Facebook page
• Issue seems to be in IE7-8 only
• Using custom @fontface fonts
• Cannot reproduce issue on VirtualBox
The issue is that the fonts load fine when the page loads originally in IE7-8, when the user goes to an interior page all @fontface fonts revert to their web-safe font backups. They will stay that way (even returning to the first page that had the fonts loaded) until the cache is cleared. The fonts load & stay loaded on the same test machine in Chrome & Foxy.
Anyone have any ideas? | 0 |
10,398,973 | 05/01/2012 14:15:53 | 1,311,082 | 04/03/2012 17:41:52 | 3 | 0 | Placement of DIV using JQuery | I'm making a website for the father of a friend and I am almost done, but there is one issue left.
In the right lower corner of the website there is a div containing a link to switch the language from german to english. This div is supposed to be always at the bottom of the screen. I tried using the JQuery Funktion Offset() to achieve this but I can't get it right.
Maybe someone can help me.
Thanks in advance.
The code: http://db.tt/gtgdgOeD
A screenshot: http://db.tt/v8FdAuRn | jquery | css | div | null | null | 05/04/2012 17:59:21 | too localized | Placement of DIV using JQuery
===
I'm making a website for the father of a friend and I am almost done, but there is one issue left.
In the right lower corner of the website there is a div containing a link to switch the language from german to english. This div is supposed to be always at the bottom of the screen. I tried using the JQuery Funktion Offset() to achieve this but I can't get it right.
Maybe someone can help me.
Thanks in advance.
The code: http://db.tt/gtgdgOeD
A screenshot: http://db.tt/v8FdAuRn | 3 |
7,324,481 | 09/06/2011 18:32:35 | 893,847 | 08/14/2011 12:31:15 | 20 | 4 | What should I know in java to be able to create desktop applications? | I know core java and have worked a little with J2EE. But I want to be creating desktop based applications in Java.<br>
What should I know in Java to be able to create Desktop based (GUI) applications? What are the alternatives to database server like Oracle for small scale database driven applications? What is the best RAD tool for such GUI based Desktop applications (for Windows OS)?
<br><br>
Thanks<br>
Raouf Athar<br>
[Yarikul][1]
[1]: http://www.yarikul.com | java | gui | null | null | null | 09/06/2011 18:45:56 | not a real question | What should I know in java to be able to create desktop applications?
===
I know core java and have worked a little with J2EE. But I want to be creating desktop based applications in Java.<br>
What should I know in Java to be able to create Desktop based (GUI) applications? What are the alternatives to database server like Oracle for small scale database driven applications? What is the best RAD tool for such GUI based Desktop applications (for Windows OS)?
<br><br>
Thanks<br>
Raouf Athar<br>
[Yarikul][1]
[1]: http://www.yarikul.com | 1 |
9,621,285 | 03/08/2012 16:37:17 | 1,131,108 | 01/05/2012 00:36:40 | 1 | 0 | Jquery script loaded multiple times with different id's how to get preloader to only load on the specific id post | I have this script + load of other function loaded multiple times and each time it's loaded it receives a unique number to the formID and script so that when the post script is requested it only loads that specific form detail.
Now the problem that i have is that this script is loaded 6 times with different id's allocated but the preloader seems to be loading through out the page, and not targeted to one preloader class.
The script works perfect in other ways as in it only refreshes the data of that specific id but it just shows all the preloader images through out the site and not just that specific one which has the same id.
Here is the script
<script>
$(document).ready(function() {
$('.preloader<?php echo $i; ?>').ajaxStart(function(){
$(this).show();}).ajaxStop(function(){
$(this).hide();
});
$.post('http://www.url.co.uk/template_load/get_box_prices.php', $("#productBox<?php echo $i; ?>").serialize(),
function(data){
$('input[id=productID<?php echo $i; ?>]').val(data.productID);
$('input[id=productDescription<?php echo $i; ?>]').val(data.productDescription);
$('input[id=productPrice<?php echo $i; ?>]').val(data.productPrice);
$('input[id=productThumb<?php echo $i; ?>]').val(data.productThumb);
$('input[id=productThumbLarge<?php echo $i; ?>]').val(data.productThumbLarge);
$('input[id=packageQuantity<?php echo $i; ?>]').val(data.packageQuantity);
$('#productSinglePrice<?php echo $i; ?>').html(data.productSinglePrice);
$('#productSmallbanner<?php echo $i; ?>').html(data.productSmallbanner);
$('#productWording<?php echo $i; ?>').html(data.productWording);
$('#productVisableDescription<?php echo $i; ?>').html(data.productVisableDescription);
console.log(data);
},'json');
$("select#productIDColor<?php echo $i; ?>").change(function(){
$('.productSinglePrice<?php echo $i; ?>').empty();
$.post('http://www.url.co.uk/template_load/get_box_prices.php', $("#productBox<?php echo $i; ?>").serialize(),
function(data){
$('input[id=productID<?php echo $i; ?>]').val(data.productID);
$('input[id=productDescription<?php echo $i; ?>]').val(data.productDescription);
$('input[id=productPrice<?php echo $i; ?>]').val(data.productPrice);
$('input[id=productThumb<?php echo $i; ?>]').val(data.productThumb);
$('input[id=productThumbLarge<?php echo $i; ?>]').val(data.productThumbLarge);
$('input[id=packageQuantity<?php echo $i; ?>]').val(data.packageQuantity);
$('#productSinglePrice<?php echo $i; ?>').html(data.productSinglePrice);
$('#productSmallbanner<?php echo $i; ?>').html(data.productSmallbanner);
$('#productWording<?php echo $i; ?>').html(data.productWording);
$('#productVisableDescription<?php echo $i; ?>').html(data.productVisableDescription);
},'json');
return false;
});
});
</script>
This is a sample element where the preloader will load contents.
<?php
if (${dynamic_boxes_.$i} == "yes")
{
echo '<table><tr><td>';
echo '<div class="preloader' . $i . '"><img src="http://www.roofracks.co.uk/template_load/img/ajax-loader.gif" /></div>';
echo '<div id="productSmallbanner' . $i . '"><div>';
echo '</td></tr>';
echo '<tr><td>';
echo '<div class="preloader' . $i . '"><img src="http://www.roofracks.co.uk/template_load/img/ajax-loader.gif" /></div>';
echo '<div id="productWording' . $i . '"><div>';
echo '</td></tr>';
echo '</td></tr></table>';
}
?>
And this is the form that gets triggered.
if (${dynamic_boxes_.$i} == "yes"){
$color[$i] = mysql_query("SELECT * FROM products_prices WHERE product='".$p[$i]."' ORDER BY color ASC",$connect) or die(mysql_error());
echo '<form name="productBox' . $i . '" id="productBox' . $i . '" action="" method="POST">
<label for="productIDColor' . $i . '">Select Colour</label>
<select name="productIDColor' . $i . '" id="productIDColor' . $i . '">';
while($colors[$i] = mysql_fetch_array($color[$i]))
{
if ($colors[$i]['color'] == "B"){$colorName = "Black";}
elseif ($colors[$i]['color'] == "S"){$colorName = "Silver";}
elseif ($colors[$i]['color'] == "T"){$colorName = "Titan";}
echo '<option value="'.$p[$i].','.$colors[$i]['color'].'">'.$colorName.'</option>';
}
echo '<input type="hidden" name="i" value="'.$i.'" />';
echo '</select></form>';
| jquery | null | null | null | null | 03/14/2012 19:22:54 | not a real question | Jquery script loaded multiple times with different id's how to get preloader to only load on the specific id post
===
I have this script + load of other function loaded multiple times and each time it's loaded it receives a unique number to the formID and script so that when the post script is requested it only loads that specific form detail.
Now the problem that i have is that this script is loaded 6 times with different id's allocated but the preloader seems to be loading through out the page, and not targeted to one preloader class.
The script works perfect in other ways as in it only refreshes the data of that specific id but it just shows all the preloader images through out the site and not just that specific one which has the same id.
Here is the script
<script>
$(document).ready(function() {
$('.preloader<?php echo $i; ?>').ajaxStart(function(){
$(this).show();}).ajaxStop(function(){
$(this).hide();
});
$.post('http://www.url.co.uk/template_load/get_box_prices.php', $("#productBox<?php echo $i; ?>").serialize(),
function(data){
$('input[id=productID<?php echo $i; ?>]').val(data.productID);
$('input[id=productDescription<?php echo $i; ?>]').val(data.productDescription);
$('input[id=productPrice<?php echo $i; ?>]').val(data.productPrice);
$('input[id=productThumb<?php echo $i; ?>]').val(data.productThumb);
$('input[id=productThumbLarge<?php echo $i; ?>]').val(data.productThumbLarge);
$('input[id=packageQuantity<?php echo $i; ?>]').val(data.packageQuantity);
$('#productSinglePrice<?php echo $i; ?>').html(data.productSinglePrice);
$('#productSmallbanner<?php echo $i; ?>').html(data.productSmallbanner);
$('#productWording<?php echo $i; ?>').html(data.productWording);
$('#productVisableDescription<?php echo $i; ?>').html(data.productVisableDescription);
console.log(data);
},'json');
$("select#productIDColor<?php echo $i; ?>").change(function(){
$('.productSinglePrice<?php echo $i; ?>').empty();
$.post('http://www.url.co.uk/template_load/get_box_prices.php', $("#productBox<?php echo $i; ?>").serialize(),
function(data){
$('input[id=productID<?php echo $i; ?>]').val(data.productID);
$('input[id=productDescription<?php echo $i; ?>]').val(data.productDescription);
$('input[id=productPrice<?php echo $i; ?>]').val(data.productPrice);
$('input[id=productThumb<?php echo $i; ?>]').val(data.productThumb);
$('input[id=productThumbLarge<?php echo $i; ?>]').val(data.productThumbLarge);
$('input[id=packageQuantity<?php echo $i; ?>]').val(data.packageQuantity);
$('#productSinglePrice<?php echo $i; ?>').html(data.productSinglePrice);
$('#productSmallbanner<?php echo $i; ?>').html(data.productSmallbanner);
$('#productWording<?php echo $i; ?>').html(data.productWording);
$('#productVisableDescription<?php echo $i; ?>').html(data.productVisableDescription);
},'json');
return false;
});
});
</script>
This is a sample element where the preloader will load contents.
<?php
if (${dynamic_boxes_.$i} == "yes")
{
echo '<table><tr><td>';
echo '<div class="preloader' . $i . '"><img src="http://www.roofracks.co.uk/template_load/img/ajax-loader.gif" /></div>';
echo '<div id="productSmallbanner' . $i . '"><div>';
echo '</td></tr>';
echo '<tr><td>';
echo '<div class="preloader' . $i . '"><img src="http://www.roofracks.co.uk/template_load/img/ajax-loader.gif" /></div>';
echo '<div id="productWording' . $i . '"><div>';
echo '</td></tr>';
echo '</td></tr></table>';
}
?>
And this is the form that gets triggered.
if (${dynamic_boxes_.$i} == "yes"){
$color[$i] = mysql_query("SELECT * FROM products_prices WHERE product='".$p[$i]."' ORDER BY color ASC",$connect) or die(mysql_error());
echo '<form name="productBox' . $i . '" id="productBox' . $i . '" action="" method="POST">
<label for="productIDColor' . $i . '">Select Colour</label>
<select name="productIDColor' . $i . '" id="productIDColor' . $i . '">';
while($colors[$i] = mysql_fetch_array($color[$i]))
{
if ($colors[$i]['color'] == "B"){$colorName = "Black";}
elseif ($colors[$i]['color'] == "S"){$colorName = "Silver";}
elseif ($colors[$i]['color'] == "T"){$colorName = "Titan";}
echo '<option value="'.$p[$i].','.$colors[$i]['color'].'">'.$colorName.'</option>';
}
echo '<input type="hidden" name="i" value="'.$i.'" />';
echo '</select></form>';
| 1 |
5,084,611 | 02/22/2011 22:10:31 | 335,036 | 10/06/2008 18:02:50 | 1,106 | 25 | Software design question - uploading Word docs or using markdown? | I've got an asp website that currently has students copying and pasting from Word into a textarea and submitting a paper that way. In this case, they can't do any formatting.
Instructors pull up the students' work and apply html spans and styles to it as commentary.
We've thought about going to a system where the student uploads a Word doc and the instructor makes comments within the doc and uploads it back for the student to view.
Would it make more sense to keep the system as a paste operation and maybe provide some markdown or rich text controls? I'm wondering about compatibility/virus/formatting/size issues with Word making it difficult to upload/download/store.
Yeah - this is a design question.. ;) | asp | word | null | null | null | null | open | Software design question - uploading Word docs or using markdown?
===
I've got an asp website that currently has students copying and pasting from Word into a textarea and submitting a paper that way. In this case, they can't do any formatting.
Instructors pull up the students' work and apply html spans and styles to it as commentary.
We've thought about going to a system where the student uploads a Word doc and the instructor makes comments within the doc and uploads it back for the student to view.
Would it make more sense to keep the system as a paste operation and maybe provide some markdown or rich text controls? I'm wondering about compatibility/virus/formatting/size issues with Word making it difficult to upload/download/store.
Yeah - this is a design question.. ;) | 0 |
10,340,360 | 04/26/2012 19:47:05 | 1,180,686 | 01/31/2012 15:36:19 | 446 | 27 | Zend gdata Framework Google Docs - Outdated filetypes Need a fix | This framework is **outdated** and doesn't support **all kind of files** to upload, so i decided to fix the framework.
In the **class Zend_Gdata_Docs**
I did this by adding the entry JPG/JPEG/PPTX
private static $SUPPORTED_FILETYPES = array(
'JPG'=>'image/jpeg',
'JPEG'=>'image/jpeg',
'TXT'=>'text/plain',
'CSV'=>'text/csv',
'TSV'=>'text/tab-separated-values',
'TAB'=>'text/tab-separated-values',
'HTML'=>'text/html',
'HTM'=>'text/html',
'DOC'=>'application/msword',
'ODS'=>'application/vnd.oasis.opendocument.spreadsheet',
'ODT'=>'application/vnd.oasis.opendocument.text',
'RTF'=>'application/rtf',
'SXW'=>'application/vnd.sun.xml.writer',
'XLS'=>'application/vnd.ms-excel',
'XLSX'=>'application/vnd.ms-excel',
'PPT'=>'application/vnd.ms-powerpoint',
'PPTX'=>'application/vnd.ms-powerpoint',
'PPS'=>'application/vnd.ms-powerpoint');
It's working fine for the .pptx and for the jpeg/jpg the upload is working completely fine but once in Google Docs it is showing like a doc...
There:
![Imge Google Docs][1]
[1]: http://i.stack.imgur.com/NCiBI.jpg | php | zend-framework | google-docs-api | google-drive-sdk | null | null | open | Zend gdata Framework Google Docs - Outdated filetypes Need a fix
===
This framework is **outdated** and doesn't support **all kind of files** to upload, so i decided to fix the framework.
In the **class Zend_Gdata_Docs**
I did this by adding the entry JPG/JPEG/PPTX
private static $SUPPORTED_FILETYPES = array(
'JPG'=>'image/jpeg',
'JPEG'=>'image/jpeg',
'TXT'=>'text/plain',
'CSV'=>'text/csv',
'TSV'=>'text/tab-separated-values',
'TAB'=>'text/tab-separated-values',
'HTML'=>'text/html',
'HTM'=>'text/html',
'DOC'=>'application/msword',
'ODS'=>'application/vnd.oasis.opendocument.spreadsheet',
'ODT'=>'application/vnd.oasis.opendocument.text',
'RTF'=>'application/rtf',
'SXW'=>'application/vnd.sun.xml.writer',
'XLS'=>'application/vnd.ms-excel',
'XLSX'=>'application/vnd.ms-excel',
'PPT'=>'application/vnd.ms-powerpoint',
'PPTX'=>'application/vnd.ms-powerpoint',
'PPS'=>'application/vnd.ms-powerpoint');
It's working fine for the .pptx and for the jpeg/jpg the upload is working completely fine but once in Google Docs it is showing like a doc...
There:
![Imge Google Docs][1]
[1]: http://i.stack.imgur.com/NCiBI.jpg | 0 |
3,499,190 | 08/17/2010 03:49:14 | 422,406 | 08/17/2010 03:45:32 | 1 | 0 | Buffer Overflow Problem!!!??!! | File: C:\Users\jeremy\AppData\Roaming\install\Svchost.exe
Can't get rid of it even when I go to it. There's nothing in the folder HElP | html | null | null | null | null | 08/17/2010 03:59:54 | not a real question | Buffer Overflow Problem!!!??!!
===
File: C:\Users\jeremy\AppData\Roaming\install\Svchost.exe
Can't get rid of it even when I go to it. There's nothing in the folder HElP | 1 |
8,049,936 | 11/08/2011 11:51:37 | 750,813 | 05/12/2011 15:05:45 | 221 | 15 | Want Action sheet to display in Local Notification event occurance... :( | I want my app should show Action sheet on Local notification event occurrence and not the default alert View.
Also wanted to know is there any way to generate any event even if my app is in Background.. like EKEventStore or something else.If yes then plz help.
Here is what i am trying for above problem:-
@class SetAlarmViewController;
@interface The420DudeAppDelegate : NSObject <UIApplicationDelegate,UIActionSheetDelegate> {
UIWindow *window;
SetAlarmViewController *viewController;
BOOL soundFlag;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet SetAlarmViewController *viewController;
@property (nonatomic) BOOL soundFlag;
extern NSString *kRemindMeNotificationDataKey;
@end
@synthesize window,viewController,soundFlag;
NSString *kRemindMeNotificationDataKey = @"kRemindMeNotificationDataKey";
#pragma mark -
#pragma mark === Application Delegate Methods ===
#pragma mark -
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
soundFlag = 0;
// Handle launching from a notification
UILocalNotification *localNotification =
[launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotification) {
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"View My Alarm",nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
sleep(1);
[self.window makeKeyAndVisible];
[window addSubview:viewController.view];
return YES;
}
- (void)application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"View My Alarm",nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
soundFlag = 1;
}
- (void)dealloc {
[window release];
[viewController release];
[super dealloc];
}
@end
@class The420DudeAppDelegate;
@interface SetAlarmViewController : UIViewController <UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UIActionSheetDelegate>{
IBOutlet UITableView *tableview;
IBOutlet UIDatePicker *datePicker;
IBOutlet UITextField *eventText;
IBOutlet UINavigationBar *titleBar;
IBOutlet UIButton *setAlarmButton;
The420DudeAppDelegate *appDelegate;
}
@property (nonatomic, retain) IBOutlet UITableView *tableview;
@property (nonatomic, retain) IBOutlet UIDatePicker *datePicker;
@property (nonatomic, retain) IBOutlet UITextField *eventText;
@property(nonatomic, retain) IBOutlet UINavigationBar *titleBar;
@property(nonatomic, retain) IBOutlet UIButton *setAlarmButton;
@property(nonatomic) UIReturnKeyType returnKeyType;
- (IBAction) scheduleAlarm:(id) sender;
- (void)showReminder:(NSString *)text;
@end
@implementation SetAlarmViewController
@synthesize datePicker,tableview, eventText,titleBar,setAlarmButton,returnKeyType;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
appDelegate = (The420DudeAppDelegate *)[[UIApplication sharedApplication] delegate];
eventText.returnKeyType = UIReturnKeyDone;
datePicker.minimumDate = [NSDate date];
NSDate *now = [NSDate date];
[datePicker setDate:now animated:YES];
eventText.delegate = self;
}
- (void) viewWillAppear:(BOOL)animated {
[self.tableview reloadData];
}
- (IBAction) scheduleAlarm:(id) sender {
[eventText resignFirstResponder];
// Get the current date
NSDate *pickerDate = [self.datePicker date];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = pickerDate;
localNotif.timeZone = [NSTimeZone localTimeZone];
// Notification details
//=================localNotif.alertBody = [eventText text];
// Set the action button
//================= localNotif.alertAction = @"Show me";
localNotif.repeatInterval = NSDayCalendarUnit;
localNotif.soundName = @"jet.wav";
//================= appDelegate.badgeCount++;
//================= localNotif.applicationIconBadgeNumber = appDelegate.badgeCount;
// Specify custom data for the notification
NSDictionary *userDict = [NSDictionary dictionaryWithObject:eventText.text forKey:kRemindMeNotificationDataKey];
localNotif.userInfo = userDict;
// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
[self.tableview reloadData];
eventText.text = @"";
}
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [[[UIApplication sharedApplication] scheduledLocalNotifications] count];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notif = [notificationArray objectAtIndex:indexPath.row];
if(notif)
{
[[UIApplication sharedApplication] cancelLocalNotification:notif];
}
[self.tableview reloadData];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notif = [notificationArray objectAtIndex:indexPath.row];
[cell.textLabel setText:notif.alertBody];
[cell.detailTextLabel setText:[notif.fireDate description]];// showing wrong time
return cell;
}
- (void)viewDidUnload {
datePicker = nil;
tableview = nil;
eventText = nil;
[super viewDidUnload];
}
#pragma mark -
#pragma mark === Text Field Delegate ===
#pragma mark -
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
#pragma mark -
#pragma mark === Public Methods ===
#pragma mark -
- (void)showReminder:(NSString *)text {
/*
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder"
message:@"hello" delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[self.tableview reloadData];
//================= appDelegate.badgeCount = 0;
[alertView release];
*/
if(appDelegate.soundFlag == 1)
{
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:text delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Yes",@"NO",nil];
// actionSheet.delegate = self;
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
// What to write in showInView...?
// [actionSheet showInView:self.view];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
}
- (void)dealloc {
[super dealloc];
[datePicker release];
[tableview release];
[eventText release];
}
@end | iphone | objective-c | iphone-sdk-4.0 | uiactionsheet | uilocalnotification | null | open | Want Action sheet to display in Local Notification event occurance... :(
===
I want my app should show Action sheet on Local notification event occurrence and not the default alert View.
Also wanted to know is there any way to generate any event even if my app is in Background.. like EKEventStore or something else.If yes then plz help.
Here is what i am trying for above problem:-
@class SetAlarmViewController;
@interface The420DudeAppDelegate : NSObject <UIApplicationDelegate,UIActionSheetDelegate> {
UIWindow *window;
SetAlarmViewController *viewController;
BOOL soundFlag;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet SetAlarmViewController *viewController;
@property (nonatomic) BOOL soundFlag;
extern NSString *kRemindMeNotificationDataKey;
@end
@synthesize window,viewController,soundFlag;
NSString *kRemindMeNotificationDataKey = @"kRemindMeNotificationDataKey";
#pragma mark -
#pragma mark === Application Delegate Methods ===
#pragma mark -
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
soundFlag = 0;
// Handle launching from a notification
UILocalNotification *localNotification =
[launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotification) {
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"View My Alarm",nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
sleep(1);
[self.window makeKeyAndVisible];
[window addSubview:viewController.view];
return YES;
}
- (void)application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"View My Alarm",nil];
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
soundFlag = 1;
}
- (void)dealloc {
[window release];
[viewController release];
[super dealloc];
}
@end
@class The420DudeAppDelegate;
@interface SetAlarmViewController : UIViewController <UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UIActionSheetDelegate>{
IBOutlet UITableView *tableview;
IBOutlet UIDatePicker *datePicker;
IBOutlet UITextField *eventText;
IBOutlet UINavigationBar *titleBar;
IBOutlet UIButton *setAlarmButton;
The420DudeAppDelegate *appDelegate;
}
@property (nonatomic, retain) IBOutlet UITableView *tableview;
@property (nonatomic, retain) IBOutlet UIDatePicker *datePicker;
@property (nonatomic, retain) IBOutlet UITextField *eventText;
@property(nonatomic, retain) IBOutlet UINavigationBar *titleBar;
@property(nonatomic, retain) IBOutlet UIButton *setAlarmButton;
@property(nonatomic) UIReturnKeyType returnKeyType;
- (IBAction) scheduleAlarm:(id) sender;
- (void)showReminder:(NSString *)text;
@end
@implementation SetAlarmViewController
@synthesize datePicker,tableview, eventText,titleBar,setAlarmButton,returnKeyType;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
appDelegate = (The420DudeAppDelegate *)[[UIApplication sharedApplication] delegate];
eventText.returnKeyType = UIReturnKeyDone;
datePicker.minimumDate = [NSDate date];
NSDate *now = [NSDate date];
[datePicker setDate:now animated:YES];
eventText.delegate = self;
}
- (void) viewWillAppear:(BOOL)animated {
[self.tableview reloadData];
}
- (IBAction) scheduleAlarm:(id) sender {
[eventText resignFirstResponder];
// Get the current date
NSDate *pickerDate = [self.datePicker date];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = pickerDate;
localNotif.timeZone = [NSTimeZone localTimeZone];
// Notification details
//=================localNotif.alertBody = [eventText text];
// Set the action button
//================= localNotif.alertAction = @"Show me";
localNotif.repeatInterval = NSDayCalendarUnit;
localNotif.soundName = @"jet.wav";
//================= appDelegate.badgeCount++;
//================= localNotif.applicationIconBadgeNumber = appDelegate.badgeCount;
// Specify custom data for the notification
NSDictionary *userDict = [NSDictionary dictionaryWithObject:eventText.text forKey:kRemindMeNotificationDataKey];
localNotif.userInfo = userDict;
// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
[self.tableview reloadData];
eventText.text = @"";
}
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [[[UIApplication sharedApplication] scheduledLocalNotifications] count];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notif = [notificationArray objectAtIndex:indexPath.row];
if(notif)
{
[[UIApplication sharedApplication] cancelLocalNotification:notif];
}
[self.tableview reloadData];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *notif = [notificationArray objectAtIndex:indexPath.row];
[cell.textLabel setText:notif.alertBody];
[cell.detailTextLabel setText:[notif.fireDate description]];// showing wrong time
return cell;
}
- (void)viewDidUnload {
datePicker = nil;
tableview = nil;
eventText = nil;
[super viewDidUnload];
}
#pragma mark -
#pragma mark === Text Field Delegate ===
#pragma mark -
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
#pragma mark -
#pragma mark === Public Methods ===
#pragma mark -
- (void)showReminder:(NSString *)text {
/*
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder"
message:@"hello" delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[self.tableview reloadData];
//================= appDelegate.badgeCount = 0;
[alertView release];
*/
if(appDelegate.soundFlag == 1)
{
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:text delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive Button" otherButtonTitles:@"Yes",@"NO",nil];
// actionSheet.delegate = self;
[actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
// What to write in showInView...?
// [actionSheet showInView:self.view];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
[actionSheet release];
}
}
- (void)dealloc {
[super dealloc];
[datePicker release];
[tableview release];
[eventText release];
}
@end | 0 |
7,509,471 | 09/22/2011 04:11:06 | 679,530 | 03/28/2011 01:54:38 | 39 | 0 | WPF maps (Coloring countries) | I want to draw a in WPF, I Want each and every state of all the countries and based on certain conditions I want to color them. I dont want to use any third party controls.how can I get the polygon shapes of each state of all the countries. | wpf | maps | countries | null | null | null | open | WPF maps (Coloring countries)
===
I want to draw a in WPF, I Want each and every state of all the countries and based on certain conditions I want to color them. I dont want to use any third party controls.how can I get the polygon shapes of each state of all the countries. | 0 |
9,980,569 | 04/02/2012 16:59:54 | 677,588 | 10/15/2010 23:53:55 | 16 | 0 | Wireless Network device driver | I am a Device Driver newbie - just worked a lot on the MAC layer, theory but have never written large amounts of LDD code. I was going through the Atheros Ath9k driver code and see that the entire 802.11 MAC functionality is in the driver. I had thought that the driver just was to translate higher level functionality to the HW.
So does the Ath9k driver do the whole 802.11xx functionality, computation, data crunching algorithms (freq allocation, etc)? Isn't that a lot of work for a DD?
Can someone please throw some light? Thanks.
Mane | device-driver | linux-device-driver | wireless | null | null | null | open | Wireless Network device driver
===
I am a Device Driver newbie - just worked a lot on the MAC layer, theory but have never written large amounts of LDD code. I was going through the Atheros Ath9k driver code and see that the entire 802.11 MAC functionality is in the driver. I had thought that the driver just was to translate higher level functionality to the HW.
So does the Ath9k driver do the whole 802.11xx functionality, computation, data crunching algorithms (freq allocation, etc)? Isn't that a lot of work for a DD?
Can someone please throw some light? Thanks.
Mane | 0 |
6,284,745 | 06/08/2011 20:19:14 | 532,434 | 12/06/2010 14:51:53 | 42 | 4 | Get the environment of the spring based web application? | How can I know the environment of the web application, I mean whether it is a local, dev, qa or prod etc. Is there any way I can determine this in spring application context file at the runtime? | java | spring | spring-mvc | java-ee | null | null | open | Get the environment of the spring based web application?
===
How can I know the environment of the web application, I mean whether it is a local, dev, qa or prod etc. Is there any way I can determine this in spring application context file at the runtime? | 0 |
11,595,197 | 07/21/2012 19:22:39 | 1,519,192 | 07/11/2012 21:59:06 | -6 | 0 | CreditCard Class and GlobalCredit Class | I created a random object with GlobalCredit Class http://www.cse.yorku.ca/common/type/api/type/lib/GlobalCredit.html
GlobalCredit credit1 = GlobalCredit.getRandom();
then im trying to output the number and expiry date of each card in the collection. Using this class:
http://www.cse.yorku.ca/common/type/api/type/lib/CreditCard.html
so basically I got to use the methods:
getExpiryDate()
getNumber()
But I dont get how GlobalCredit and CreditCard Class relate to each other?
GlobalCredit credit1 = GlobalCredit.getRandom();
int expiry = credit1.getExpiryDate();
I need a way to use "getExpiryDate()" method on GlobalCredit object...
| java | homework | null | null | null | 07/22/2012 09:49:12 | too localized | CreditCard Class and GlobalCredit Class
===
I created a random object with GlobalCredit Class http://www.cse.yorku.ca/common/type/api/type/lib/GlobalCredit.html
GlobalCredit credit1 = GlobalCredit.getRandom();
then im trying to output the number and expiry date of each card in the collection. Using this class:
http://www.cse.yorku.ca/common/type/api/type/lib/CreditCard.html
so basically I got to use the methods:
getExpiryDate()
getNumber()
But I dont get how GlobalCredit and CreditCard Class relate to each other?
GlobalCredit credit1 = GlobalCredit.getRandom();
int expiry = credit1.getExpiryDate();
I need a way to use "getExpiryDate()" method on GlobalCredit object...
| 3 |
4,007,436 | 10/24/2010 07:39:42 | 127,488 | 06/23/2009 10:32:10 | 341 | 23 | What is the best way to tell a client that a software project will be late? | Hypothetical situation:
You are doing a software/web development project for a client, but you know that you will not be able to make the deadline.
As the deadline approaches, you can clearly see that you will not be able to make it. How do you tell your client this, in a professional way, without upsetting the client too much.
Do you invent technical excuses? Do you be open and honest, and tell them you are late, and don't have an excuse? What has worked for you in the past?
| project-management | projects | clients | deadlines | null | 09/29/2011 16:43:15 | not constructive | What is the best way to tell a client that a software project will be late?
===
Hypothetical situation:
You are doing a software/web development project for a client, but you know that you will not be able to make the deadline.
As the deadline approaches, you can clearly see that you will not be able to make it. How do you tell your client this, in a professional way, without upsetting the client too much.
Do you invent technical excuses? Do you be open and honest, and tell them you are late, and don't have an excuse? What has worked for you in the past?
| 4 |
10,997,651 | 06/12/2012 13:24:52 | 1,449,637 | 06/11/2012 18:20:07 | 6 | 0 | simple game to make only using python | I have only started learning python recently. I would still be considered a beginner. Does anyone know any simple games I could make using only python or python turtle. I have no experience with pygame or tkinter yet. The game does not need to use graphics. For example one of my recent games was trying to guess the letters of a random word. Simple game. Kind of like hangman. I will consider all answers. Thank you :) | python | graphics | turtle | null | null | 06/12/2012 13:33:47 | not constructive | simple game to make only using python
===
I have only started learning python recently. I would still be considered a beginner. Does anyone know any simple games I could make using only python or python turtle. I have no experience with pygame or tkinter yet. The game does not need to use graphics. For example one of my recent games was trying to guess the letters of a random word. Simple game. Kind of like hangman. I will consider all answers. Thank you :) | 4 |
5,696,164 | 04/17/2011 20:18:39 | 61,821 | 02/03/2009 07:31:53 | 1,847 | 128 | Read selected text in Firefox Fennec? | How to read selected text in Firefox Fennec Mobile? | android | firefox-addon | fennec | null | null | 02/24/2012 20:42:36 | not a real question | Read selected text in Firefox Fennec?
===
How to read selected text in Firefox Fennec Mobile? | 1 |
6,780,221 | 07/21/2011 17:33:54 | 809,051 | 06/21/2011 18:32:38 | 1 | 1 | Perl syntax error, but I cant find it for the life of me | This error is angering me. I cant see anything near those lines with a paranthesis error or missing brackets. Someone give me a hand? This is my first post, forgive me if the formatting is off; I think I got it right.
EDIT: line 87, the ');' error, is this line: select(SEXTANT_DAEMON_LOG);
syntax error at -edited- line 87, near ");"
syntax error at -edited- line 92, near "if"
syntax error at -edited- line 99, near "if"
Unmatched right curly bracket at -edited- line 102, at end of line
syntax error at -edited- line 102, near "}"
syntax error at -edited- line 109, near "}"
syntax error at -edited- line 120, near ");"
BEGIN not safe after errors--compilation aborted at -edited- line 122.
use strict;
use warnings;
use Getopt::Long;
use DBI;
use POSIX;
use Date::Parse;
use Time::HiRes qw( usleep );
use Data::Dumper;
package main;
my ($cpid1, $cpid2, $daemon_mode, $DEBUG, $fs_logfile, $tmp, $MAIN_DBH, $FS_DBH, $HDS_DBH, $TCD_DBH, $MS_DBH, $script_name, $SEXTANT_DAEMON_LOCKFILE, $reset_connections, $single_func, $show_funcs, $show_help, $dry_run);
my (@time_realtime_base, @time_realtime_now, @time_historical_base, @time_historical_now, @tmp);
GetOptions( 'daemon' => \$daemon_mode,
'debug' => \$DEBUG,
'func=s' => \$single_func,
'show-functions' => \$show_funcs,
'help' => \$show_help,
'usage' => \$show_help
);
if (defined($show_help)) {
printUsage();
exit(0);
}
if (defined($single_func)) {
if (defined($daemon_mode)) {
printUsage();
exit(0);
}
$single_func =~ s/^.*=(\w+)$/$1/;
}
my %SEXTANT_DAEMON_ERR = (
'mysql' => {
1146 => 21
},
'Sybase' => {
208 => 5
}
);
my %SEXTANT_DBH_RESET = ('Main' => 0, 'Sextant' => 0, 'hds' => 0, 'ms' => 0, 'tcd' => 0);
my $MSSQL_QUEUE_REPLICATION = 0;
my @realtime_funcs = (
'AgentRealTimeData', 'CallTypeRealTimeData', 'ServiceRealTimeData', 'SkillGroupRealTimeData'
);
my @structural_funcs = (
'ICRGlobalsData', 'AgentData', 'AgentTeamData', 'AgentTeamMemberData',
'SkillGroupData', 'SkillGroupMemberData', 'ServiceData', 'ServiceMemberData',
'CallTypeData', 'PeripheralData', 'PersonData', 'DialedNumberData',
'DialedNumberMapData', 'BucketIntervalData', 'ReasonCodeData'
);
my @tcd_funcs = (
'TerminationCallDetailData', 'RouteCallDetailData'
);
my @historical_funcs = (
'AgentHistoricalData', 'CallTypeHistoricalData', 'ServiceHistoricalData',
'SkillGroupHistoricalData', 'AgentSkillGroupHistoricalData', 'PeripheralHistoricalData', 'DialedNumberHistoricalData', 'StaffingCostHistoricalData',
'FacilityCostHistoricalData'
);
my $REALTIME_THROTTLE = 10;
my $HISTORICAL_THROTTLE = 180;
if (defined($show_funcs)) {
print("Realtime funcs\n" . Dumper(sort(@realtime_funcs)));
print("\nStructural funcs\n" . Dumper(sort(@structural_funcs)));
print("\nTCD funcs\n" . Dumper(sort(@tcd_funcs)));
print("\nHistorical funcs\n" . Dumper(sort(@historical_funcs)));
exit(0);
}
$MAIN_DBH = getConnection('Main');
$fs_logfile = getCSConfigValue($MAIN_DBH, 'Log', 'Sextant Update Daemon') or die "pid$$[" . localtime(time()) . "] Main dbh error: " . DBI::errstr;
open(SEXTANT_DAEMON_LOG, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open log file '$fs_logfile'\n";
$tmp = select(SEXTANT_DAEMON_LOG);
$| = 1;
select(SEXTANT_DAEMON_LOG);
if ($daemon_mode) {
log_message('daemon mode started, attempting to fork...', 1);
defined($cpid1 = fork()) or die "pid$$[" . localtime(time()) . "] unable to fork: $!\n";
if ($cpid1) {
log_message('fork1 successful, child PID=' . $cpid1 . ', exiting...', 1);
close(SEXTANT_DAEMON_LOG);
$MAIN_DBH->disconnect();
exit(0);
}
POSIX::setsid() or die "pid$$[" . localtime(time()) . "] unable to set session leader\n";
defined($cpid2 = fork()) or die "pid$$[" . localtime(time()) . "] unable to fork: $!\n";
if ($cpid2) {
log_message('fork2 successful, child PID=' . $cpid2 . ', exiting...', 1);
close(SEXTANT_DAEMON_LOG);
$MAIN_DBH->disconnect();
exit(0);
}
log_message('child (daemon) started', 1);
chdir('/');
umask(0);
open(STDIN, '<', '/dev/null') or die "pid$$[" . localtime(time()) . "] unable to open stdin stream to /dev/null, exiting...";
open(STDOUT, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stdout stream to $fs_logfile, exiting...";
open(STDERR, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stderr stream to $fs_logfile, exiting...";
}
else {
log_message('non-daemon mode started', 1);
}
getScriptName(\$script_name);
$SEXTANT_DAEMON_LOCKFILE = checkLock($script_name);
$MAIN_DBH = getConnection('Main');
$FS_DBH = getConnection('Sextant');
$HDS_DBH = getConnection('hds');
$MS_DBH = undef;
$TCD_DBH = undef;
if (defined($single_func)) {
open(STDOUT, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stdout stream to $fs_logfile, exiting...";
open(STDERR, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stderr stream to $fs_logfile, exiting...";
$single_func = sprintf("update_%s", $single_func);
log_message('single function test: ' . $single_func);
my $rv = 0;
{
no strict 'refs';
$rv = &$single_func();
}
$tmp = '';
foreach (keys(%SEXTANT_DBH_RESET)) { $tmp .= $_ . '=>' . $SEXTANT_DBH_RESET{$_} . ' '; }
log_message("$single_func() complete; rv = $rv; reset flags = $tmp");
exit(0);
}
@time_realtime_base = @time_historical_base = Time::HiRes::gettimeofday();
| perl | syntax-error | null | null | null | null | open | Perl syntax error, but I cant find it for the life of me
===
This error is angering me. I cant see anything near those lines with a paranthesis error or missing brackets. Someone give me a hand? This is my first post, forgive me if the formatting is off; I think I got it right.
EDIT: line 87, the ');' error, is this line: select(SEXTANT_DAEMON_LOG);
syntax error at -edited- line 87, near ");"
syntax error at -edited- line 92, near "if"
syntax error at -edited- line 99, near "if"
Unmatched right curly bracket at -edited- line 102, at end of line
syntax error at -edited- line 102, near "}"
syntax error at -edited- line 109, near "}"
syntax error at -edited- line 120, near ");"
BEGIN not safe after errors--compilation aborted at -edited- line 122.
use strict;
use warnings;
use Getopt::Long;
use DBI;
use POSIX;
use Date::Parse;
use Time::HiRes qw( usleep );
use Data::Dumper;
package main;
my ($cpid1, $cpid2, $daemon_mode, $DEBUG, $fs_logfile, $tmp, $MAIN_DBH, $FS_DBH, $HDS_DBH, $TCD_DBH, $MS_DBH, $script_name, $SEXTANT_DAEMON_LOCKFILE, $reset_connections, $single_func, $show_funcs, $show_help, $dry_run);
my (@time_realtime_base, @time_realtime_now, @time_historical_base, @time_historical_now, @tmp);
GetOptions( 'daemon' => \$daemon_mode,
'debug' => \$DEBUG,
'func=s' => \$single_func,
'show-functions' => \$show_funcs,
'help' => \$show_help,
'usage' => \$show_help
);
if (defined($show_help)) {
printUsage();
exit(0);
}
if (defined($single_func)) {
if (defined($daemon_mode)) {
printUsage();
exit(0);
}
$single_func =~ s/^.*=(\w+)$/$1/;
}
my %SEXTANT_DAEMON_ERR = (
'mysql' => {
1146 => 21
},
'Sybase' => {
208 => 5
}
);
my %SEXTANT_DBH_RESET = ('Main' => 0, 'Sextant' => 0, 'hds' => 0, 'ms' => 0, 'tcd' => 0);
my $MSSQL_QUEUE_REPLICATION = 0;
my @realtime_funcs = (
'AgentRealTimeData', 'CallTypeRealTimeData', 'ServiceRealTimeData', 'SkillGroupRealTimeData'
);
my @structural_funcs = (
'ICRGlobalsData', 'AgentData', 'AgentTeamData', 'AgentTeamMemberData',
'SkillGroupData', 'SkillGroupMemberData', 'ServiceData', 'ServiceMemberData',
'CallTypeData', 'PeripheralData', 'PersonData', 'DialedNumberData',
'DialedNumberMapData', 'BucketIntervalData', 'ReasonCodeData'
);
my @tcd_funcs = (
'TerminationCallDetailData', 'RouteCallDetailData'
);
my @historical_funcs = (
'AgentHistoricalData', 'CallTypeHistoricalData', 'ServiceHistoricalData',
'SkillGroupHistoricalData', 'AgentSkillGroupHistoricalData', 'PeripheralHistoricalData', 'DialedNumberHistoricalData', 'StaffingCostHistoricalData',
'FacilityCostHistoricalData'
);
my $REALTIME_THROTTLE = 10;
my $HISTORICAL_THROTTLE = 180;
if (defined($show_funcs)) {
print("Realtime funcs\n" . Dumper(sort(@realtime_funcs)));
print("\nStructural funcs\n" . Dumper(sort(@structural_funcs)));
print("\nTCD funcs\n" . Dumper(sort(@tcd_funcs)));
print("\nHistorical funcs\n" . Dumper(sort(@historical_funcs)));
exit(0);
}
$MAIN_DBH = getConnection('Main');
$fs_logfile = getCSConfigValue($MAIN_DBH, 'Log', 'Sextant Update Daemon') or die "pid$$[" . localtime(time()) . "] Main dbh error: " . DBI::errstr;
open(SEXTANT_DAEMON_LOG, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open log file '$fs_logfile'\n";
$tmp = select(SEXTANT_DAEMON_LOG);
$| = 1;
select(SEXTANT_DAEMON_LOG);
if ($daemon_mode) {
log_message('daemon mode started, attempting to fork...', 1);
defined($cpid1 = fork()) or die "pid$$[" . localtime(time()) . "] unable to fork: $!\n";
if ($cpid1) {
log_message('fork1 successful, child PID=' . $cpid1 . ', exiting...', 1);
close(SEXTANT_DAEMON_LOG);
$MAIN_DBH->disconnect();
exit(0);
}
POSIX::setsid() or die "pid$$[" . localtime(time()) . "] unable to set session leader\n";
defined($cpid2 = fork()) or die "pid$$[" . localtime(time()) . "] unable to fork: $!\n";
if ($cpid2) {
log_message('fork2 successful, child PID=' . $cpid2 . ', exiting...', 1);
close(SEXTANT_DAEMON_LOG);
$MAIN_DBH->disconnect();
exit(0);
}
log_message('child (daemon) started', 1);
chdir('/');
umask(0);
open(STDIN, '<', '/dev/null') or die "pid$$[" . localtime(time()) . "] unable to open stdin stream to /dev/null, exiting...";
open(STDOUT, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stdout stream to $fs_logfile, exiting...";
open(STDERR, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stderr stream to $fs_logfile, exiting...";
}
else {
log_message('non-daemon mode started', 1);
}
getScriptName(\$script_name);
$SEXTANT_DAEMON_LOCKFILE = checkLock($script_name);
$MAIN_DBH = getConnection('Main');
$FS_DBH = getConnection('Sextant');
$HDS_DBH = getConnection('hds');
$MS_DBH = undef;
$TCD_DBH = undef;
if (defined($single_func)) {
open(STDOUT, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stdout stream to $fs_logfile, exiting...";
open(STDERR, '>>', $fs_logfile) or die "pid$$[" . localtime(time()) . "] unable to open stderr stream to $fs_logfile, exiting...";
$single_func = sprintf("update_%s", $single_func);
log_message('single function test: ' . $single_func);
my $rv = 0;
{
no strict 'refs';
$rv = &$single_func();
}
$tmp = '';
foreach (keys(%SEXTANT_DBH_RESET)) { $tmp .= $_ . '=>' . $SEXTANT_DBH_RESET{$_} . ' '; }
log_message("$single_func() complete; rv = $rv; reset flags = $tmp");
exit(0);
}
@time_realtime_base = @time_historical_base = Time::HiRes::gettimeofday();
| 0 |
11,596,224 | 07/21/2012 22:10:58 | 1,092,437 | 12/11/2011 16:39:31 | 37 | 2 | Does anyone know the OS distro, editor and how is he spliting screens? | If you look at http://bambuser.com/v/2846316 you can see a developer with two monitors, in the video this person is spliting the screens into multiple outputs of an editor. And switching the content of them... Does anyone know how to do something like this ? Or the editor he/she is using ? I think the distro is Archlinux and the website on the movie is http://japh.se
Thank you | linux | archlinux | null | null | null | 07/22/2012 01:59:13 | off topic | Does anyone know the OS distro, editor and how is he spliting screens?
===
If you look at http://bambuser.com/v/2846316 you can see a developer with two monitors, in the video this person is spliting the screens into multiple outputs of an editor. And switching the content of them... Does anyone know how to do something like this ? Or the editor he/she is using ? I think the distro is Archlinux and the website on the movie is http://japh.se
Thank you | 2 |
6,380,158 | 06/17/2011 00:27:49 | 701,267 | 04/10/2011 21:30:41 | 91 | 0 | Sending anonymous data | I see and use some software that as this option.
How exactly those this work? How those it send and is it collected?
I like to implement a small test.
| delphi | feedback | null | null | null | 06/17/2011 06:43:49 | not a real question | Sending anonymous data
===
I see and use some software that as this option.
How exactly those this work? How those it send and is it collected?
I like to implement a small test.
| 1 |
2,223,935 | 02/08/2010 18:34:19 | 268,881 | 02/08/2010 18:34:19 | 1 | 0 | In Wix, how would you create a dialog to choose the name of a subfolder of the main application directory? | I am developing a MSI installer by using WIX.
The main program installs to [APPLICATIONFOLDER]. I use the InstallDirDlg to set the directory of this without any issues.
I'd like to display a custom dialogue based on the InstallDirDlg to specify a directory to install a particular component. I'd like to set the default directory to [APPLICATIONFOLDER]\Resources. However when I run the installer, I get an error, code 2343.
I think this may be a problem with displaying a second level folder in the dialogue. | wix | dialog | folder | null | null | null | open | In Wix, how would you create a dialog to choose the name of a subfolder of the main application directory?
===
I am developing a MSI installer by using WIX.
The main program installs to [APPLICATIONFOLDER]. I use the InstallDirDlg to set the directory of this without any issues.
I'd like to display a custom dialogue based on the InstallDirDlg to specify a directory to install a particular component. I'd like to set the default directory to [APPLICATIONFOLDER]\Resources. However when I run the installer, I get an error, code 2343.
I think this may be a problem with displaying a second level folder in the dialogue. | 0 |
6,231,586 | 06/03/2011 19:13:07 | 591,016 | 01/26/2011 17:28:14 | 57 | 1 | Android ViewRoot NullPointerException | This causes the error:
this.addContentView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
I'm thinking I am having problem with activities/context and getting the right one on the right thread, but I'm not sure how else to approach this.
Not sure what the problem is, here is the trace:
ViewRoot.draw(boolean) line: 1440
ViewRoot.performTraversals() line: 1172
ViewRoot.handleMessage(Message) line: 1736
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 143
ActivityThread.main(String[]) line: 4701
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Here is my code:
public class LiveTabGroup extends ActivityGroup implements MoveToScreenNotification.handler
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
EventBus.subscribe(MoveToScreenNotification.class, this);
View view = getLocalActivityManager().startActivity("CameraListView", new Intent(this,CameraListView.class).
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
this.setContentView(view);
}
@Override
public void onMoveToScreenNotification(MoveToScreenNotification notif)
{
if (notif.newScreen == MoveToScreenNotification.SCREEN_MOVIEPLAYER_LIVE)
{
SugarLoafSingleton.currentCamera.url = notif.videoURL;
// Throw UI management on main thread
runOnUiThread(new Runnable(){
public void run()
{
StartPlayer();
}
});
}
}
public void StartPlayer()
{
View view = getLocalActivityManager().startActivity("VideoPlayer", new Intent(this,VideoPlayerView.class).
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
this.addContentView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
}
}
| android | nullpointerexception | null | null | null | null | open | Android ViewRoot NullPointerException
===
This causes the error:
this.addContentView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
I'm thinking I am having problem with activities/context and getting the right one on the right thread, but I'm not sure how else to approach this.
Not sure what the problem is, here is the trace:
ViewRoot.draw(boolean) line: 1440
ViewRoot.performTraversals() line: 1172
ViewRoot.handleMessage(Message) line: 1736
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 143
ActivityThread.main(String[]) line: 4701
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Here is my code:
public class LiveTabGroup extends ActivityGroup implements MoveToScreenNotification.handler
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
EventBus.subscribe(MoveToScreenNotification.class, this);
View view = getLocalActivityManager().startActivity("CameraListView", new Intent(this,CameraListView.class).
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
this.setContentView(view);
}
@Override
public void onMoveToScreenNotification(MoveToScreenNotification notif)
{
if (notif.newScreen == MoveToScreenNotification.SCREEN_MOVIEPLAYER_LIVE)
{
SugarLoafSingleton.currentCamera.url = notif.videoURL;
// Throw UI management on main thread
runOnUiThread(new Runnable(){
public void run()
{
StartPlayer();
}
});
}
}
public void StartPlayer()
{
View view = getLocalActivityManager().startActivity("VideoPlayer", new Intent(this,VideoPlayerView.class).
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();
this.addContentView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT));
}
}
| 0 |
4,646,180 | 01/10/2011 11:10:20 | 246,544 | 01/08/2010 16:35:48 | 26 | 10 | Joomla ssl problem | I have a site on joomla and I want to make some specific pages works by secure connection ,
other by simple http connection. Is there some step-by-step manual how to setup apache and joomla for such needs. | apache | ssl | joomla | null | null | null | open | Joomla ssl problem
===
I have a site on joomla and I want to make some specific pages works by secure connection ,
other by simple http connection. Is there some step-by-step manual how to setup apache and joomla for such needs. | 0 |
8,358,137 | 12/02/2011 14:54:27 | 413,766 | 08/07/2010 10:30:31 | 436 | 23 | Windows 7 - remove limitation on number of concurrent connections | I have an application that tries to open as many http requests as possible (in order to stress test a proxy implementation)
It seems to me that Win7 (SP1) may have a limitation on number of concurrent opened connection (it may be the so called half-open state if I'm not wrong). Is there something I can do for client ? and also I test using a vista PC that acts as a proxy server.
It would be great if I could configure it to sustain at least 50 new connections initiated / second on client side and many more on server. | windows | tcp | null | null | null | 12/02/2011 16:39:07 | off topic | Windows 7 - remove limitation on number of concurrent connections
===
I have an application that tries to open as many http requests as possible (in order to stress test a proxy implementation)
It seems to me that Win7 (SP1) may have a limitation on number of concurrent opened connection (it may be the so called half-open state if I'm not wrong). Is there something I can do for client ? and also I test using a vista PC that acts as a proxy server.
It would be great if I could configure it to sustain at least 50 new connections initiated / second on client side and many more on server. | 2 |
4,296,037 | 11/28/2010 08:46:20 | 519,411 | 11/24/2010 21:33:41 | 1 | 2 | how to show list object page in android?? | a have trowble in my listing program. How to show list objek data on web in android?? this is my code:
<pre>
public void loadData() {
String data = txtSeach.getText().toString();
textView = (TextView) findViewById(R.id.mytextView);
String result = "";
// the year data to send
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("search", data));
InputStream is = null;
// http post
try {
URL url = new URL("http://www.grouprecipes.com/search");
URLConnection connection = url.openConnection();
connection.connect();
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.grouprecipes.com/"
+ data + "/");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection " + e.toString());
}
// convert response to string
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result = sb.toString();
textView.append(result);
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
}
// parse json data
try {
JSONArray jArray = new JSONArray(result);
for (int i = 0; i < jArray.length(); i++) {
// JSONObject json_data = jArray.getJSONObject(i);
JSONObject jsonObject = new JSONObject(result);
// textView.setTag(json_data);
// textView.getContext();
/*
* Log.i("log_tag","id: "+json_data.getInt("id")+
* ", name: "+json_data.getString("name")+
* ", sex: "+json_data.getInt("sex")+
* ", birthyear: "+json_data.getInt("birthyear")
*
* );
*/
}
} catch (JSONException e) {
Log.e("log_tag", "Error parsing data " + e.toString());
}
}`
| android | null | null | null | null | null | open | how to show list object page in android??
===
a have trowble in my listing program. How to show list objek data on web in android?? this is my code:
<pre>
public void loadData() {
String data = txtSeach.getText().toString();
textView = (TextView) findViewById(R.id.mytextView);
String result = "";
// the year data to send
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("search", data));
InputStream is = null;
// http post
try {
URL url = new URL("http://www.grouprecipes.com/search");
URLConnection connection = url.openConnection();
connection.connect();
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.grouprecipes.com/"
+ data + "/");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection " + e.toString());
}
// convert response to string
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result = sb.toString();
textView.append(result);
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
}
// parse json data
try {
JSONArray jArray = new JSONArray(result);
for (int i = 0; i < jArray.length(); i++) {
// JSONObject json_data = jArray.getJSONObject(i);
JSONObject jsonObject = new JSONObject(result);
// textView.setTag(json_data);
// textView.getContext();
/*
* Log.i("log_tag","id: "+json_data.getInt("id")+
* ", name: "+json_data.getString("name")+
* ", sex: "+json_data.getInt("sex")+
* ", birthyear: "+json_data.getInt("birthyear")
*
* );
*/
}
} catch (JSONException e) {
Log.e("log_tag", "Error parsing data " + e.toString());
}
}`
| 0 |
7,823,594 | 10/19/2011 15:16:10 | 1,003,445 | 10/19/2011 15:10:19 | 1 | 0 | Which WAMP package(s) is great for production use and is secure? | Which WAMP package(s) do you think is/are great for production use and is secure?
Thanks very much. | windows | package | wamp | wampserver | null | 10/19/2011 21:52:31 | off topic | Which WAMP package(s) is great for production use and is secure?
===
Which WAMP package(s) do you think is/are great for production use and is secure?
Thanks very much. | 2 |
11,383,142 | 07/08/2012 12:27:03 | 1,494,179 | 07/01/2012 11:14:57 | 26 | 0 | Exercises of "code-checking" | I have searched on the internet for C programming exercises of the type:
*Consider the following code: **-code-** .
What is the output of the code?/Is it correct?/(and similar questions)*
but I haven't found much. In particular, I'm interested in those which deal with **recursion**. Any help is welcome! | c | homework | practice | recurrence | null | 07/08/2012 12:49:58 | off topic | Exercises of "code-checking"
===
I have searched on the internet for C programming exercises of the type:
*Consider the following code: **-code-** .
What is the output of the code?/Is it correct?/(and similar questions)*
but I haven't found much. In particular, I'm interested in those which deal with **recursion**. Any help is welcome! | 2 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.