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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,102,302 | 06/23/2010 14:01:41 | 129,099 | 06/25/2009 21:33:37 | 213 | 11 | Insert in to database using codeigniter | HI
i want to insert data using form in CI but i am facing the problem
Here is my model code
function add_form()
{
$this->load->database();
$id = $this->input->post('id');
$name = $this->input->post('name');
$age = $this->input->post('age');
$data = array(
'name' => $this->input->post('name'),
'age' => $this->input->post('age'),
);
$this->db->insert('user',$data);
}
Here is my controller code
function simpleform()
{
$this->load->helper('form');
$this->load->helper('html');
$this->load->model('welcomedb_model');
if($this->input->post('submit')){
$this->welcomedb_model->add_form();
}
$this->load->view('welcomedb_view');
}
and here is my view code
<?php echo form_open('welcomedb/submit'); ?>
<? echo $name; ?>:
<? echo form_input('name'); ?>
</br>
<? echo $age; ?>:
<? echo form_input('age'); ?>
</br>
<?php echo form_submit('submit', 'Submit'); ?>
<?php echo form_close(); ?>
Thanks for your help | codeigniter | null | null | null | null | null | open | Insert in to database using codeigniter
===
HI
i want to insert data using form in CI but i am facing the problem
Here is my model code
function add_form()
{
$this->load->database();
$id = $this->input->post('id');
$name = $this->input->post('name');
$age = $this->input->post('age');
$data = array(
'name' => $this->input->post('name'),
'age' => $this->input->post('age'),
);
$this->db->insert('user',$data);
}
Here is my controller code
function simpleform()
{
$this->load->helper('form');
$this->load->helper('html');
$this->load->model('welcomedb_model');
if($this->input->post('submit')){
$this->welcomedb_model->add_form();
}
$this->load->view('welcomedb_view');
}
and here is my view code
<?php echo form_open('welcomedb/submit'); ?>
<? echo $name; ?>:
<? echo form_input('name'); ?>
</br>
<? echo $age; ?>:
<? echo form_input('age'); ?>
</br>
<?php echo form_submit('submit', 'Submit'); ?>
<?php echo form_close(); ?>
Thanks for your help | 0 |
4,293,770 | 11/27/2010 20:34:01 | 401,995 | 07/24/2010 03:40:57 | 554 | 5 | What keyword/types a C++ beginner should know? | What keyword/data types do beginner needs to know like statc, extern, HRESULT... | c++ | types | keywords | null | null | 11/28/2010 03:38:05 | not a real question | What keyword/types a C++ beginner should know?
===
What keyword/data types do beginner needs to know like statc, extern, HRESULT... | 1 |
11,228,603 | 06/27/2012 14:33:02 | 693,011 | 04/05/2011 13:47:12 | 1 | 0 | Report Viewer 2012 Redistributable for SQL Server 2012 | Just migrating from SQL Server 2008 R2 to SQL Server 2012. So I'm facing with trouble: i can't find Report Viewer 2012 Runtime. I found only CTP and Beta Version on Microsoft Downloads. Where can i download it? Thank you. | reportviewer | sql-server-2012 | null | null | null | 07/06/2012 13:44:57 | not a real question | Report Viewer 2012 Redistributable for SQL Server 2012
===
Just migrating from SQL Server 2008 R2 to SQL Server 2012. So I'm facing with trouble: i can't find Report Viewer 2012 Runtime. I found only CTP and Beta Version on Microsoft Downloads. Where can i download it? Thank you. | 1 |
6,441,788 | 06/22/2011 14:41:58 | 12,597 | 09/16/2008 14:53:25 | 11,934 | 267 | SaferCreateLevel SAFER_LEVELID_UNTRUSTED: The application was unable to start correctly (0xc0000142) | i'm trying to launch a process (*any* process) as "**untrusted**" using the [`SaferCreateLevel`][1] with the `SAFER_LEVELID_UNTRUSTED` safer level:
> Allows programs to execute with access only to resources granted to open well-known groups, blocking access to **Administrator** and **Power User** privileges and personally granted rights.
Using the code from Michael Howards DropMyRights MDSN article ([Browsing the Web and Reading E-mail Safely as an Administrator][2]) the pseudo-code is:
//get a handler on a Safer level
hSaferLevel = SaferCreateLevel(SAFER_SCOPEID_USER, SAFER_LEVELID_UNTRUSTED);
//Create a security token out of the safer level handle
hSecurityToken = SaferComputeTokenFromLevel(hSaferLevel);
//Create process as user
CreateProcessAsUser(hSecurityToken, "myapp.exe");
Except that the process fails to launch:
> The application was unable to start correctly (0xc0000142).
![enter image description here][3]
What's going on here?
----------
My application **is** able to handle running as a "low" user.
The end goal was to run the process with the same privelages as a **MandatoryIntegrity\Low** process would get (although not tagged as low). So i tested that.
i used `icacls` to mark [my application to run **Mandatory Integrity Level\Low**][4]:
C:\Develop>icacls RTMS.exe /setintegritylevel Low
processed file: RTMS.exe
Successfully processed 1 files; Failed processing 0 files
And my application launches correctly, and is running at the low integrity level:
![enter image description here][5]
While i might be able to use the [`AddMandatoryAce`][6] API, or fiddle with the ACLs in the security token myself, i'm curious what's up with an `UNTRUSTED` Safer level - and why i can't get anything to launch.
**Note:** On Windows 7 if you mark `calc` or `notepad` as `/setintegritylevel low` they will fail to launch (no error, just never appear), even [though this MSDN article talks about using calc as a test of low integrity level][7]:
![enter image description here][8]
[1]: http://msdn.microsoft.com/en-us/library/ms722425%28v=vs.85%29.aspx
[2]: http://msdn.microsoft.com/en-us/library/ms972827.aspx
[3]: http://i.stack.imgur.com/81HwV.png
[4]: http://msdn.microsoft.com/en-us/library/bb625960.aspx
[5]: http://i.stack.imgur.com/fR670.jpg
[6]: http://blogs.msdn.com/b/cjacks/archive/2006/10/24/modifying-the-mandatory-integrity-level-for-a-securable-object-in-windows-vista.aspx
[7]: http://msdn.microsoft.com/en-us/library/bb625960.aspx
[8]: http://i.stack.imgur.com/10gkM.gif | security | winapi | uac | null | null | null | open | SaferCreateLevel SAFER_LEVELID_UNTRUSTED: The application was unable to start correctly (0xc0000142)
===
i'm trying to launch a process (*any* process) as "**untrusted**" using the [`SaferCreateLevel`][1] with the `SAFER_LEVELID_UNTRUSTED` safer level:
> Allows programs to execute with access only to resources granted to open well-known groups, blocking access to **Administrator** and **Power User** privileges and personally granted rights.
Using the code from Michael Howards DropMyRights MDSN article ([Browsing the Web and Reading E-mail Safely as an Administrator][2]) the pseudo-code is:
//get a handler on a Safer level
hSaferLevel = SaferCreateLevel(SAFER_SCOPEID_USER, SAFER_LEVELID_UNTRUSTED);
//Create a security token out of the safer level handle
hSecurityToken = SaferComputeTokenFromLevel(hSaferLevel);
//Create process as user
CreateProcessAsUser(hSecurityToken, "myapp.exe");
Except that the process fails to launch:
> The application was unable to start correctly (0xc0000142).
![enter image description here][3]
What's going on here?
----------
My application **is** able to handle running as a "low" user.
The end goal was to run the process with the same privelages as a **MandatoryIntegrity\Low** process would get (although not tagged as low). So i tested that.
i used `icacls` to mark [my application to run **Mandatory Integrity Level\Low**][4]:
C:\Develop>icacls RTMS.exe /setintegritylevel Low
processed file: RTMS.exe
Successfully processed 1 files; Failed processing 0 files
And my application launches correctly, and is running at the low integrity level:
![enter image description here][5]
While i might be able to use the [`AddMandatoryAce`][6] API, or fiddle with the ACLs in the security token myself, i'm curious what's up with an `UNTRUSTED` Safer level - and why i can't get anything to launch.
**Note:** On Windows 7 if you mark `calc` or `notepad` as `/setintegritylevel low` they will fail to launch (no error, just never appear), even [though this MSDN article talks about using calc as a test of low integrity level][7]:
![enter image description here][8]
[1]: http://msdn.microsoft.com/en-us/library/ms722425%28v=vs.85%29.aspx
[2]: http://msdn.microsoft.com/en-us/library/ms972827.aspx
[3]: http://i.stack.imgur.com/81HwV.png
[4]: http://msdn.microsoft.com/en-us/library/bb625960.aspx
[5]: http://i.stack.imgur.com/fR670.jpg
[6]: http://blogs.msdn.com/b/cjacks/archive/2006/10/24/modifying-the-mandatory-integrity-level-for-a-securable-object-in-windows-vista.aspx
[7]: http://msdn.microsoft.com/en-us/library/bb625960.aspx
[8]: http://i.stack.imgur.com/10gkM.gif | 0 |
6,706,256 | 07/15/2011 11:19:29 | 778,993 | 06/01/2011 08:21:02 | 31 | 0 | Feedback on first programming project, browser compatibility | I know this isn't a straightforward question but I would really appreciate some feedback on this. This has been my first shot at programming and when I started it, I got some really good help from here.
http://koti.mbnet.fi/bugs/pohjoisespoo/ <- You'll find the site there
http://koti.mbnet.fi/bugs/pohjoisespoo/kartta3.js <- All the javascript
http://koti.mbnet.fi/bugs/pohjoisespoo/raphael-zpd.js <- The zoom pan drag script (by somnidea)
http://koti.mbnet.fi/bugs/pohjoisespoo/sivu.css
Most of my issues are probably caused by my poor programming but also I think the zoom and panning script I'm using (https://github.com/somnidea/raphael-zpd) doesn't work with IE. I'm ready to change the whole script if it's the best option so be honest. However, I don't need IE6 support and I'm fine with even IE7 support missing. However, I believe there's some issues with it on Firefox v.3 as well. Newer Firefoxes and Google Chrome should work.
My next phase is to create a simple collapsible comment section under each of the bubble info sections. I'm guessing PHP is the way to go. What I need is super simple messaging board where conversations can be continued under comments to the main tree which can be collapsed. There's some tutorials for similar things online but if anyone knows a good method I'd appreciate the guidance. As you can guess I have no experience with databases etc. so I don't know if security could be an issue with my beginner skills. I also need a simple moderation tool. Otherwise what i'd like to do is let the users attach pins to the map which would show when a comment is highlighted. Is this kind of interaction between the PHP and JS feasible?
I appreciate any tips with anything.
Thank you for your help,
Ilkka Syrjakari
| php | javascript | raphael | feedback | null | 07/16/2011 07:29:16 | not constructive | Feedback on first programming project, browser compatibility
===
I know this isn't a straightforward question but I would really appreciate some feedback on this. This has been my first shot at programming and when I started it, I got some really good help from here.
http://koti.mbnet.fi/bugs/pohjoisespoo/ <- You'll find the site there
http://koti.mbnet.fi/bugs/pohjoisespoo/kartta3.js <- All the javascript
http://koti.mbnet.fi/bugs/pohjoisespoo/raphael-zpd.js <- The zoom pan drag script (by somnidea)
http://koti.mbnet.fi/bugs/pohjoisespoo/sivu.css
Most of my issues are probably caused by my poor programming but also I think the zoom and panning script I'm using (https://github.com/somnidea/raphael-zpd) doesn't work with IE. I'm ready to change the whole script if it's the best option so be honest. However, I don't need IE6 support and I'm fine with even IE7 support missing. However, I believe there's some issues with it on Firefox v.3 as well. Newer Firefoxes and Google Chrome should work.
My next phase is to create a simple collapsible comment section under each of the bubble info sections. I'm guessing PHP is the way to go. What I need is super simple messaging board where conversations can be continued under comments to the main tree which can be collapsed. There's some tutorials for similar things online but if anyone knows a good method I'd appreciate the guidance. As you can guess I have no experience with databases etc. so I don't know if security could be an issue with my beginner skills. I also need a simple moderation tool. Otherwise what i'd like to do is let the users attach pins to the map which would show when a comment is highlighted. Is this kind of interaction between the PHP and JS feasible?
I appreciate any tips with anything.
Thank you for your help,
Ilkka Syrjakari
| 4 |
9,704,564 | 03/14/2012 15:05:53 | 419,284 | 08/13/2010 07:22:32 | 185 | 2 | A case of "forloop" | I meet a case of forloop, the condition is the parameter(p) itself, when will the forloop stop? I don't find this case in my C++ books. Thanks!
for (PDFS *p = e->prev ; p ; p = p->prev) {
push_back (p->edge);
edge[p->edge->id] = vertex[p->edge->from] = vertex[p->edge->to] = 1;
} | c++ | null | null | null | null | null | open | A case of "forloop"
===
I meet a case of forloop, the condition is the parameter(p) itself, when will the forloop stop? I don't find this case in my C++ books. Thanks!
for (PDFS *p = e->prev ; p ; p = p->prev) {
push_back (p->edge);
edge[p->edge->id] = vertex[p->edge->from] = vertex[p->edge->to] = 1;
} | 0 |
8,105,812 | 11/12/2011 16:32:40 | 670,674 | 03/22/2011 06:09:25 | 1 | 0 | C#.Net Webservice error handling | I wrote following webservice, when project not found then I want that webservice method only return
<<error>error> No Project Found <</error>/error>
and not any other thing.
Project GetProject(int Project_id)
{
Project dmo = new Project();
ProjectDAO dao = new ProjectDAO();
dmo = dao.GetProject(Project_id);
return dmo;
} | c# | web-services | error-handling | null | null | 11/13/2011 00:07:56 | not a real question | C#.Net Webservice error handling
===
I wrote following webservice, when project not found then I want that webservice method only return
<<error>error> No Project Found <</error>/error>
and not any other thing.
Project GetProject(int Project_id)
{
Project dmo = new Project();
ProjectDAO dao = new ProjectDAO();
dmo = dao.GetProject(Project_id);
return dmo;
} | 1 |
6,594,389 | 07/06/2011 09:43:13 | 831,288 | 07/06/2011 09:43:13 | 1 | 0 | wijmo date picker using in textbox | Need examples for wijmo date picker using in text box. i m having trouble in using wijmo date picker. it is working when i m suing in div but not in textbox
here is my code:
<%: Html.TextBox("sample")%>
$(document).ready(function () {
$("#texts").wijcalendar({
easing: 'easeInQuad'
});
}); | asp.net-mvc-2 | wijmo | null | null | null | null | open | wijmo date picker using in textbox
===
Need examples for wijmo date picker using in text box. i m having trouble in using wijmo date picker. it is working when i m suing in div but not in textbox
here is my code:
<%: Html.TextBox("sample")%>
$(document).ready(function () {
$("#texts").wijcalendar({
easing: 'easeInQuad'
});
}); | 0 |
11,169,530 | 06/23/2012 12:33:18 | 1,461,397 | 06/17/2012 04:02:40 | 4 | 0 | Creating a custom ui element and making it respond to user input | I have a volume knob and would like to know how to make it respond to user input in android. Please point me in the right direction as i have no idea how i can go about it ? [Custom Knob][1] looks like something created in this article. My question is what would be the general approach to port this knob into an android application. Do i have to extend the view class and draw this as a Bitmap. If so how exactly would i respond to user input. If this is not possible and i am on the wrong track could someone please tell me how to achieve this?
[1]: http://www.photoshop-plus.co.uk/2011/09/14/learn-how-to-create-a-gui-volume-dialknob/ | android | user-interface | null | null | null | null | open | Creating a custom ui element and making it respond to user input
===
I have a volume knob and would like to know how to make it respond to user input in android. Please point me in the right direction as i have no idea how i can go about it ? [Custom Knob][1] looks like something created in this article. My question is what would be the general approach to port this knob into an android application. Do i have to extend the view class and draw this as a Bitmap. If so how exactly would i respond to user input. If this is not possible and i am on the wrong track could someone please tell me how to achieve this?
[1]: http://www.photoshop-plus.co.uk/2011/09/14/learn-how-to-create-a-gui-volume-dialknob/ | 0 |
8,247,935 | 11/23/2011 19:25:32 | 1,062,604 | 11/23/2011 19:16:38 | 1 | 0 | Need help finding name of function | My friend sent me an encoded string which I would assume is Java or C#, but since I code in neither of them I could need some help. The string is as follows:
0x579fb13
I thought about it being base 64 or so at first, but the 0x indicates it's hex or something.
Any help appreciated. | c# | java | function | encryption | null | 11/24/2011 11:48:08 | not a real question | Need help finding name of function
===
My friend sent me an encoded string which I would assume is Java or C#, but since I code in neither of them I could need some help. The string is as follows:
0x579fb13
I thought about it being base 64 or so at first, but the 0x indicates it's hex or something.
Any help appreciated. | 1 |
10,957,297 | 06/08/2012 23:59:34 | 1,253,637 | 03/07/2012 02:05:24 | 64 | 0 | rod cutting algorithmwith atmost k cuts | Could any one post the solution for rod cutting problem with atmost k cuts?
Couldn't crack the solution, so was curious to know.
I need a dynamic programming solution.
Thanks. | algorithm | dynamic-programming | null | null | null | 06/09/2012 00:16:30 | not a real question | rod cutting algorithmwith atmost k cuts
===
Could any one post the solution for rod cutting problem with atmost k cuts?
Couldn't crack the solution, so was curious to know.
I need a dynamic programming solution.
Thanks. | 1 |
10,334,190 | 04/26/2012 13:14:24 | 1,358,743 | 04/26/2012 12:59:58 | 1 | 0 | Android Market: for hours no sales / downloads | I'm developer some Android apps and I sell it over Google Market (Play).
I notice something strange in the last days. My app will be normally downloaded ca. 1 time per hour. Sometimes more, sometimes less.
But last days I notice something like failure/downtimes of market, take a look, these ranges got my app no downloads:
April 25 11:52 PM - April 26 7:14 AM
April 23 11:12 PM - April 24 5:25 AM
I know, there are other Apps like mine, I know may be no one purchases it really ... but it seems a bit too strange for me.
A lot of hours no downloads and then at least 1 download per hour again.
My app is since 2009 on Market, also no new app or so.
Is it possible, google market has downtimes? Or other problems? Is somethere a place to check it out? Please do not point me to google-support, it's terrible and most helpless. I have already experiences on it.
| android | android-market | google-play | null | null | 04/27/2012 14:16:15 | off topic | Android Market: for hours no sales / downloads
===
I'm developer some Android apps and I sell it over Google Market (Play).
I notice something strange in the last days. My app will be normally downloaded ca. 1 time per hour. Sometimes more, sometimes less.
But last days I notice something like failure/downtimes of market, take a look, these ranges got my app no downloads:
April 25 11:52 PM - April 26 7:14 AM
April 23 11:12 PM - April 24 5:25 AM
I know, there are other Apps like mine, I know may be no one purchases it really ... but it seems a bit too strange for me.
A lot of hours no downloads and then at least 1 download per hour again.
My app is since 2009 on Market, also no new app or so.
Is it possible, google market has downtimes? Or other problems? Is somethere a place to check it out? Please do not point me to google-support, it's terrible and most helpless. I have already experiences on it.
| 2 |
6,475,023 | 06/25/2011 00:33:42 | 814,910 | 06/25/2011 00:33:42 | 1 | 0 | Book recommendation for project architecture? | I already have a solid knowledge of Object-oriented PHP as well as HTML/Javascript/MySQL plus a basis in Java.
Now I would like to implement my projects in an efficient way, whether it is a web project in PHP or an Android application.
My problem is once my code gets bigger I start messing error handling, with form validation etc, and I guess its because of my poor basis in software architecture.
Thanks. | java | php | architecture | books | null | 06/25/2011 03:54:07 | not constructive | Book recommendation for project architecture?
===
I already have a solid knowledge of Object-oriented PHP as well as HTML/Javascript/MySQL plus a basis in Java.
Now I would like to implement my projects in an efficient way, whether it is a web project in PHP or an Android application.
My problem is once my code gets bigger I start messing error handling, with form validation etc, and I guess its because of my poor basis in software architecture.
Thanks. | 4 |
5,913,525 | 05/06/2011 15:23:54 | 138,557 | 07/15/2009 08:10:18 | 1,864 | 89 | Get url for current page, but with a different format. | Using rails 2. I want a link to the current page (whatever it is) that keeps all of the params the same but changes the format to 'csv'. (setting the format can be done by having format=csv in the params or by putting .csv at the end of the path). Eg
posts/1
=> posts/1.csv OR posts/1?format=csv
posts?name=jim
=> posts.csv?name=jim OR posts?name=jim&format=csv
I tried this as a hacky attempt
`request.url+"&format=csv"`
and that works fine if there are params in the current url (case 2 above) but breaks if there aren't (case 1). I could come up with more hacky stuff along these lines, eg testing if the request has params, but i'm thinking there must be a nicer way.
cheers, max
EDIT - btw, it's not guaranteed that the current page could have a named route associated with it, in case that's relevant: we could have got there via the generic "/:controller/:action/:id" route. | ruby-on-rails | null | null | null | null | null | open | Get url for current page, but with a different format.
===
Using rails 2. I want a link to the current page (whatever it is) that keeps all of the params the same but changes the format to 'csv'. (setting the format can be done by having format=csv in the params or by putting .csv at the end of the path). Eg
posts/1
=> posts/1.csv OR posts/1?format=csv
posts?name=jim
=> posts.csv?name=jim OR posts?name=jim&format=csv
I tried this as a hacky attempt
`request.url+"&format=csv"`
and that works fine if there are params in the current url (case 2 above) but breaks if there aren't (case 1). I could come up with more hacky stuff along these lines, eg testing if the request has params, but i'm thinking there must be a nicer way.
cheers, max
EDIT - btw, it's not guaranteed that the current page could have a named route associated with it, in case that's relevant: we could have got there via the generic "/:controller/:action/:id" route. | 0 |
7,717,233 | 10/10/2011 18:50:18 | 62,201 | 02/04/2009 00:31:39 | 1,090 | 69 | Book Recommendation: Batch Processing Patterns | I'd like to find books for Batch Processing Patterns. Do you know some ? | batch | batch-processing | null | null | null | 10/10/2011 20:03:23 | not constructive | Book Recommendation: Batch Processing Patterns
===
I'd like to find books for Batch Processing Patterns. Do you know some ? | 4 |
10,009,921 | 04/04/2012 11:11:08 | 1,312,637 | 04/04/2012 10:52:48 | 1 | 0 | Method that takes an array of integers, data and index and create two local arrays , called less and more | Method that takes an array of integers, data and index and create two local arrays , called less and more, which contain values from data which are less than and more than the value data[index], use append(), use void sort(int[] data) (should be recursively sort) recombine the output using join(). The index variable is also local and set to be the position of the middle index of the array. For ex, data={4,9,8,5,2,1}, index=3, then the outputof the method split will be less = {4,2,1}, more{9,8} | java | null | null | null | null | 04/04/2012 12:12:02 | not a real question | Method that takes an array of integers, data and index and create two local arrays , called less and more
===
Method that takes an array of integers, data and index and create two local arrays , called less and more, which contain values from data which are less than and more than the value data[index], use append(), use void sort(int[] data) (should be recursively sort) recombine the output using join(). The index variable is also local and set to be the position of the middle index of the array. For ex, data={4,9,8,5,2,1}, index=3, then the outputof the method split will be less = {4,2,1}, more{9,8} | 1 |
1,160,888 | 07/21/2009 18:28:13 | 142,215 | 07/21/2009 18:28:13 | 1 | 0 | How do I merge/join mp3 files with c# | I have a library of different words/phrases, and in order to build sentences at present I add a combination of these phrases into a playlist to make a sentence. Unfortunately if the user is running cpu intensive applications (which most of my users are) there can be a lag of a few seconds mid-sentence (in between phrases).
In order to combat this I was thinking of an approach which will merge the right combination of mp3 files on the fly into an appropriate phrase, save this in the %temp% directory, and then play this 1 mp3 which should overcome the problem I'm experiencing with gaps.
What is the easiest way to do this in c#? Is there an easy way to do this? The files are fairly small, 3-4 seconds long each, and a sentence can consist of 3-20ish phrases. | mp3 | c# | join | merge | null | null | open | How do I merge/join mp3 files with c#
===
I have a library of different words/phrases, and in order to build sentences at present I add a combination of these phrases into a playlist to make a sentence. Unfortunately if the user is running cpu intensive applications (which most of my users are) there can be a lag of a few seconds mid-sentence (in between phrases).
In order to combat this I was thinking of an approach which will merge the right combination of mp3 files on the fly into an appropriate phrase, save this in the %temp% directory, and then play this 1 mp3 which should overcome the problem I'm experiencing with gaps.
What is the easiest way to do this in c#? Is there an easy way to do this? The files are fairly small, 3-4 seconds long each, and a sentence can consist of 3-20ish phrases. | 0 |
9,592,969 | 03/06/2012 22:31:16 | 489,564 | 10/28/2010 01:35:03 | 129 | 1 | tmux: how to put 2 opened windows side-by-side? | I have opened two windows in a tmux session, how can I put them side-by-side like splitted horizontally? | session | split | side-by-side | tmux | null | 03/07/2012 22:05:44 | off topic | tmux: how to put 2 opened windows side-by-side?
===
I have opened two windows in a tmux session, how can I put them side-by-side like splitted horizontally? | 2 |
5,444,322 | 03/26/2011 18:26:28 | 678,267 | 03/26/2011 18:26:28 | 1 | 0 | How to trigger an android app on the phone using the laptop? | I have an application on my G1 Android Dev phone(android 1.5). I need to trigger this application automatically from my laptop. The system will not be deployed in an area where there is WiFi, so I cannot send a packet to a service on the phone which will be listening for a particular packet from the laptop and then call an intent to launch my application. Is there any way in which I can send out a packet using the USB cable to a service running on the laptop? Are there APIs available for this? | android | null | null | null | null | null | open | How to trigger an android app on the phone using the laptop?
===
I have an application on my G1 Android Dev phone(android 1.5). I need to trigger this application automatically from my laptop. The system will not be deployed in an area where there is WiFi, so I cannot send a packet to a service on the phone which will be listening for a particular packet from the laptop and then call an intent to launch my application. Is there any way in which I can send out a packet using the USB cable to a service running on the laptop? Are there APIs available for this? | 0 |
2,781,995 | 05/06/2010 14:51:41 | 275,807 | 02/18/2010 05:34:36 | 178 | 8 | VB Script and filename with space | I wrote a VBS file to open the "6 May" folder with following content
path = "F:\Test\2010\May\6 May"
Set Sh = CreateObject("WSCript.Shell")
Sh.Run ""path"",3,True
Set Sh = Nothing
However on executing this I am getting following error
---------------------------
Windows Script Host
---------------------------
Script: F:\Sperry\2010\May\_06 May\open.vbs
Line: 4
Char: 10
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
---------------------------
OK
---------------------------
Can anyone help me in this? | vbscript | scripting | null | null | null | null | open | VB Script and filename with space
===
I wrote a VBS file to open the "6 May" folder with following content
path = "F:\Test\2010\May\6 May"
Set Sh = CreateObject("WSCript.Shell")
Sh.Run ""path"",3,True
Set Sh = Nothing
However on executing this I am getting following error
---------------------------
Windows Script Host
---------------------------
Script: F:\Sperry\2010\May\_06 May\open.vbs
Line: 4
Char: 10
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
---------------------------
OK
---------------------------
Can anyone help me in this? | 0 |
8,947,141 | 01/20/2012 19:57:55 | 1,161,354 | 01/20/2012 19:45:07 | 1 | 0 | How can I change runtime language in Delphi (language files created with ITE)? | I'm developing a multilingual application in Delphi 2007. I've created needed language files in ITE and I would like to change the application language in runtime.
I just took a look into RichEdit Demo, where user can change the language, but I can't reproduce it in my application.
How can I do it?
Gettext for Delphi sounds great, but I can't udederstand the line below:
>Q: How do I switch language at runtime?
>
>A: See the source of the TntSample application that is included in the download for Delphi.
I must find additional manuals :). | delphi | runtime | multilingual | null | null | 01/21/2012 03:43:39 | not a real question | How can I change runtime language in Delphi (language files created with ITE)?
===
I'm developing a multilingual application in Delphi 2007. I've created needed language files in ITE and I would like to change the application language in runtime.
I just took a look into RichEdit Demo, where user can change the language, but I can't reproduce it in my application.
How can I do it?
Gettext for Delphi sounds great, but I can't udederstand the line below:
>Q: How do I switch language at runtime?
>
>A: See the source of the TntSample application that is included in the download for Delphi.
I must find additional manuals :). | 1 |
11,687,047 | 07/27/2012 11:41:08 | 1,477,037 | 06/23/2012 16:09:46 | 1 | 0 | Play framework 1.0. Where can I learn groovy UI templating | Play framework 1.0. Where can I learn groovy UI templating. I am new to Play. Need to learn groovy based template for Play 1.0. Any advice or links. | groovy | playframework | null | null | null | 07/27/2012 14:58:10 | not constructive | Play framework 1.0. Where can I learn groovy UI templating
===
Play framework 1.0. Where can I learn groovy UI templating. I am new to Play. Need to learn groovy based template for Play 1.0. Any advice or links. | 4 |
9,185,433 | 02/07/2012 23:08:05 | 927,974 | 09/04/2011 20:59:46 | 12 | 0 | Trouble setting up apache on vmware | I'm trying to set up a virtual machine (vmware workstation 8.0.2) running CentOS 6.2 (i386) to mirror my live server so I can work locally. I'm running Windows 7 64bit. I have installed CentOS, PHP & MySQL they all seem to be running fine.
I now need to get it to access my files on the windows machine. I've installed the VMware tools and can now see the shared folder in /mnt/hgfs/Work/. I now need to point apache to the files here so it can use them, to do this I edited httpd.conf from:
DocumentRoot "/var/www/html"
to
DocumentRoot "/mnt/hgfs" (also tried DocumentRoot "/mnt/hgfs/Work")
when I restart apache it fails and I get:
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
I've used Linux, but not very often so it's probably something obvious I've missed, I'd really appreciate any help on this.
| php | apache | vmware | null | null | null | open | Trouble setting up apache on vmware
===
I'm trying to set up a virtual machine (vmware workstation 8.0.2) running CentOS 6.2 (i386) to mirror my live server so I can work locally. I'm running Windows 7 64bit. I have installed CentOS, PHP & MySQL they all seem to be running fine.
I now need to get it to access my files on the windows machine. I've installed the VMware tools and can now see the shared folder in /mnt/hgfs/Work/. I now need to point apache to the files here so it can use them, to do this I edited httpd.conf from:
DocumentRoot "/var/www/html"
to
DocumentRoot "/mnt/hgfs" (also tried DocumentRoot "/mnt/hgfs/Work")
when I restart apache it fails and I get:
Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
I've used Linux, but not very often so it's probably something obvious I've missed, I'd really appreciate any help on this.
| 0 |
3,021,050 | 06/11/2010 07:45:33 | 364,320 | 06/11/2010 07:45:33 | 1 | 0 | Write TIFF float images using CImg | I'm using CImg and I have noticed that I cant write TIFF images with float data. CImg wrotes them as 1byte/per pixel integer images.
¿Does anyone know if it is possible to write float images? Or, do you know other lib to do it.
| c++ | image | float | tiff | cimg | null | open | Write TIFF float images using CImg
===
I'm using CImg and I have noticed that I cant write TIFF images with float data. CImg wrotes them as 1byte/per pixel integer images.
¿Does anyone know if it is possible to write float images? Or, do you know other lib to do it.
| 0 |
3,179,723 | 07/05/2010 13:12:12 | 57,428 | 01/21/2009 08:23:46 | 34,574 | 1,013 | Please explain this joke about Ruby | From [How to Shoot Yourself in the Foot in Any Programming Language][1]:
> Ruby. Your foot is ready to be shot in roughly five minutes, but you just can’t find anywhere to shoot it.
I don't have experience with Ruby. I guess the first part states that development is fast. What's the meaning of "just can't find where to shoot it" part?
[1]: http://www.fullduplex.org/humor/2006/10/how-to-shoot-yourself-in-the-foot-in-any-programming-language/ | ruby | null | null | null | null | 07/06/2010 21:52:26 | not a real question | Please explain this joke about Ruby
===
From [How to Shoot Yourself in the Foot in Any Programming Language][1]:
> Ruby. Your foot is ready to be shot in roughly five minutes, but you just can’t find anywhere to shoot it.
I don't have experience with Ruby. I guess the first part states that development is fast. What's the meaning of "just can't find where to shoot it" part?
[1]: http://www.fullduplex.org/humor/2006/10/how-to-shoot-yourself-in-the-foot-in-any-programming-language/ | 1 |
4,808,661 | 01/26/2011 18:53:52 | 580,462 | 01/18/2011 19:50:06 | 6 | 1 | How do I show that there are scalars s and t so that sa+tb = <x, y, z> is true? | My textbook only has one similar example with <x,y> vectors, and the same method did not yield the correct answer for me when I tried to apply it to the question I am working on.
Let a = <-4, 2, -3> and b = <0, 3, -5>. Show that there are scalars s and t so that sa+tb = <16,1,-3>.
c = <16, 1, -3>
c = sa+tb
I got 1/3 for t and -23/6 for s. Both are incorrect.
I then plug-in values to solve, but I feel as if I'm not doing it correctly. Can anyone point out my error?
Thank you in advance. | vector | calculus | null | null | null | 01/26/2011 19:05:05 | off topic | How do I show that there are scalars s and t so that sa+tb = <x, y, z> is true?
===
My textbook only has one similar example with <x,y> vectors, and the same method did not yield the correct answer for me when I tried to apply it to the question I am working on.
Let a = <-4, 2, -3> and b = <0, 3, -5>. Show that there are scalars s and t so that sa+tb = <16,1,-3>.
c = <16, 1, -3>
c = sa+tb
I got 1/3 for t and -23/6 for s. Both are incorrect.
I then plug-in values to solve, but I feel as if I'm not doing it correctly. Can anyone point out my error?
Thank you in advance. | 2 |
8,547,225 | 12/17/2011 19:07:19 | 1,063,911 | 11/24/2011 12:27:07 | 1 | 0 | Apple reject iPad app | We have developed an iPad application and submit it to the apple store for review after properly tested at our end. But apple reject our app and give the following reason:-
We found that your app failed to launch on iPad running iOS 5.0.1, on both Wi-Fi and cellular networks
We encountered the issue when selecting the application on the Home screen - the app displayed a launch image then quit unexpectedly. This may be because iOS 5 uses a watchdog timer for applications; if an application takes too long to complete its initial startup, the operating system terminates the application.
For information about the watchdog timer, please see Technical Q&A: Application does not crash when launched from debugger but crashes when launched by user..
Another possibility could be a missing entitlement. For more information, please see the Technical Note: Resolving "0x800003A", applications not launching and "missing entitlement".
We are not able to understand abut why apple has rejected the app since we are not able to reproduce this issue at our end. and apple feedback is not much descriptive.
So what can we do to workaround this problem and resubmit it to apple store.
Thanks,
Sandeep
| iphone | objective-c | ios | ios5 | null | 12/18/2011 16:00:23 | off topic | Apple reject iPad app
===
We have developed an iPad application and submit it to the apple store for review after properly tested at our end. But apple reject our app and give the following reason:-
We found that your app failed to launch on iPad running iOS 5.0.1, on both Wi-Fi and cellular networks
We encountered the issue when selecting the application on the Home screen - the app displayed a launch image then quit unexpectedly. This may be because iOS 5 uses a watchdog timer for applications; if an application takes too long to complete its initial startup, the operating system terminates the application.
For information about the watchdog timer, please see Technical Q&A: Application does not crash when launched from debugger but crashes when launched by user..
Another possibility could be a missing entitlement. For more information, please see the Technical Note: Resolving "0x800003A", applications not launching and "missing entitlement".
We are not able to understand abut why apple has rejected the app since we are not able to reproduce this issue at our end. and apple feedback is not much descriptive.
So what can we do to workaround this problem and resubmit it to apple store.
Thanks,
Sandeep
| 2 |
7,934,338 | 10/28/2011 20:06:43 | 543,572 | 07/28/2010 20:27:47 | 303 | 31 | A scripting language for web services apis for handling documents? | I'm investigating using a scripting language in order to call a web service that handles documents in a repository database. I'm thinking about powershell or perl, but I don't have much experience with using scripts to call web services.
As far as the api's, they are mostly just get/put operations for the files and the files are xml based.
We are looking at scripts as something that would be easy to use, compact code, portable, and rapid implementation.
Does anyone have any experience with this and has a recommendation, based on the above items? | web-services | perl | scripting | powershell | xmldocument | null | open | A scripting language for web services apis for handling documents?
===
I'm investigating using a scripting language in order to call a web service that handles documents in a repository database. I'm thinking about powershell or perl, but I don't have much experience with using scripts to call web services.
As far as the api's, they are mostly just get/put operations for the files and the files are xml based.
We are looking at scripts as something that would be easy to use, compact code, portable, and rapid implementation.
Does anyone have any experience with this and has a recommendation, based on the above items? | 0 |
2,840,655 | 05/15/2010 15:33:46 | 157,032 | 08/15/2009 21:10:37 | 21 | 6 | Trying to simplify some Javascript with closures | I'm trying to simplify some JS code that uses closures but I am getting nowhere (probably because I'm not grokking closures)
I have some code that looks like this:
var server = http.createServer(function (request, response) {
var httpmethods = {
"GET": function() {
alert('GET')
},
"PUT": function() {
alert('PUT')
}
};
});
And I'm trying to simplify it in this way:
var server = http.createServer(function (request, response) {
var httpmethods = {
"GET": function() {
alertGET()
},
"PUT": function() {
alertPUT()
}
};
});
function alertGET() {
alert('GET');
}
function alertPUT() {
alert('PUT');
}
Unfortunately that doesnt seem to work...
Thus:
- what am I doing wrong?
- is it possible to do this?
- how?
TIA
-- MV
| javascript | closures | null | null | null | null | open | Trying to simplify some Javascript with closures
===
I'm trying to simplify some JS code that uses closures but I am getting nowhere (probably because I'm not grokking closures)
I have some code that looks like this:
var server = http.createServer(function (request, response) {
var httpmethods = {
"GET": function() {
alert('GET')
},
"PUT": function() {
alert('PUT')
}
};
});
And I'm trying to simplify it in this way:
var server = http.createServer(function (request, response) {
var httpmethods = {
"GET": function() {
alertGET()
},
"PUT": function() {
alertPUT()
}
};
});
function alertGET() {
alert('GET');
}
function alertPUT() {
alert('PUT');
}
Unfortunately that doesnt seem to work...
Thus:
- what am I doing wrong?
- is it possible to do this?
- how?
TIA
-- MV
| 0 |
4,035,006 | 10/27/2010 15:37:53 | 138,557 | 07/15/2009 08:10:18 | 910 | 46 | Rails timestamps don't use the right timezone | I'm a bit confused about timezones in rails. I want my rails app to use British Summer Time (like daylight savings in the US) for the timestamps set in updated_at and created_at in my models. I changed my environment.rb to say
config.time_zone = 'London'
The ubuntu server my app is on seems to use BST for it's time: in the command line, for example, if i type 'date' i get the current time (not offset by an hour). In the rails console, i see the following:
>> time = Time.now
=> Wed Oct 27 16:29:17 +0100 2010
>> time.zone
=> "BST"
All fine. However, if i make a new AR model object and save it, the timestamps are from an hour ago. So, it looks like this is using UTC. Now, i can see the logic in this: since the timestamps might be used in the model logic, you want them to be based on an unvarying yardstick time, ie UTC. But, this is a weird bit of behaviour that i don't understand:
#change a record and save it
>> someobj.save
=> true
#object's updated_at is one hour ago
>> someobj.updated_at
=> Wed, 27 Oct 2010 15:34:22 UTC +00:00
>> Time.now
=> Wed Oct 27 16:34:31 +0100 2010
#however, Time.now - object's updated at is just a few seconds.
>> Time.now - someobj.updated_at
=> 15.305549
So, before doing the subtraction, updated_at is converted into the current time zone.
The reason i want to show the date in the current time zone is just for status reports etc in the views: if someone updates something i want them to see that it was updated '1 minute ago' not 'one hour ago'.
Can anyone unconfuse me? cheers, max
| ruby-on-rails | datetime | timezone | null | null | null | open | Rails timestamps don't use the right timezone
===
I'm a bit confused about timezones in rails. I want my rails app to use British Summer Time (like daylight savings in the US) for the timestamps set in updated_at and created_at in my models. I changed my environment.rb to say
config.time_zone = 'London'
The ubuntu server my app is on seems to use BST for it's time: in the command line, for example, if i type 'date' i get the current time (not offset by an hour). In the rails console, i see the following:
>> time = Time.now
=> Wed Oct 27 16:29:17 +0100 2010
>> time.zone
=> "BST"
All fine. However, if i make a new AR model object and save it, the timestamps are from an hour ago. So, it looks like this is using UTC. Now, i can see the logic in this: since the timestamps might be used in the model logic, you want them to be based on an unvarying yardstick time, ie UTC. But, this is a weird bit of behaviour that i don't understand:
#change a record and save it
>> someobj.save
=> true
#object's updated_at is one hour ago
>> someobj.updated_at
=> Wed, 27 Oct 2010 15:34:22 UTC +00:00
>> Time.now
=> Wed Oct 27 16:34:31 +0100 2010
#however, Time.now - object's updated at is just a few seconds.
>> Time.now - someobj.updated_at
=> 15.305549
So, before doing the subtraction, updated_at is converted into the current time zone.
The reason i want to show the date in the current time zone is just for status reports etc in the views: if someone updates something i want them to see that it was updated '1 minute ago' not 'one hour ago'.
Can anyone unconfuse me? cheers, max
| 0 |
10,149,066 | 04/13/2012 22:22:08 | 1,332,555 | 04/13/2012 22:00:27 | 1 | 0 | How do I get Lua Lanes to work with my game server? | I've been racking my brain at this all day and I just cannot figure it out. My server uses a single state that loads all of my scripts in as global variables (for calling any time without having to `luaL_dofile` each time I want to run a script). The problem comes in when I attempt to use lanes. `require "lanes"` works as it should (I think? It returns a table to package.loaded appropriately...) since I have the lanes.lua in the appropriate directory on Linux (Ubuntu 11.10 x86). However, when I go to do `lanes.gen("", functionName)` it tells me... `attempt to index global 'lanes': a nil value`. At this point I decided to try `package.loaded["lanes"].gen("", functionName)` and it tells me... `attempt to index field 'gen': a nil value` If you need more information, please let me know. Thank you in advance for at least trying to help. | c | multithreading | api | lua | lua-lanes | 04/16/2012 15:33:47 | not a real question | How do I get Lua Lanes to work with my game server?
===
I've been racking my brain at this all day and I just cannot figure it out. My server uses a single state that loads all of my scripts in as global variables (for calling any time without having to `luaL_dofile` each time I want to run a script). The problem comes in when I attempt to use lanes. `require "lanes"` works as it should (I think? It returns a table to package.loaded appropriately...) since I have the lanes.lua in the appropriate directory on Linux (Ubuntu 11.10 x86). However, when I go to do `lanes.gen("", functionName)` it tells me... `attempt to index global 'lanes': a nil value`. At this point I decided to try `package.loaded["lanes"].gen("", functionName)` and it tells me... `attempt to index field 'gen': a nil value` If you need more information, please let me know. Thank you in advance for at least trying to help. | 1 |
8,530,617 | 12/16/2011 06:34:05 | 998,487 | 10/17/2011 03:55:21 | 5 | 0 | Android application integration | <b>I am new to Android application development, i want to integrate with my Android app. So please guide me what to do this. I have tried to learn things from internet but till i have found no solution so please tell me some tips
Thanks in advance </b> | android | null | null | null | null | null | open | Android application integration
===
<b>I am new to Android application development, i want to integrate with my Android app. So please guide me what to do this. I have tried to learn things from internet but till i have found no solution so please tell me some tips
Thanks in advance </b> | 0 |
6,006,803 | 05/15/2011 06:06:31 | 35,092 | 11/06/2008 14:07:57 | 36,224 | 1,358 | Suggested technologies for reimplementing stackoverflow.com | Okay, this was an excellent question from a n00b which got, I think mistakenly, closed. So I'm going to ask it again myself.
Question: If you were going to reimplement SO now, what technologies would you use? What technologies would you use if you were restricted to Java technologies.
| architecture | scalability | null | null | null | null | open | Suggested technologies for reimplementing stackoverflow.com
===
Okay, this was an excellent question from a n00b which got, I think mistakenly, closed. So I'm going to ask it again myself.
Question: If you were going to reimplement SO now, what technologies would you use? What technologies would you use if you were restricted to Java technologies.
| 0 |
3,600,204 | 08/30/2010 12:16:42 | 58,856 | 01/25/2009 20:18:45 | 3,707 | 283 | Mixing percent and fixed CSS | This is a duplicate from UI.StackExchange.com, apparently it didn't belong there: <br/>
[http://ui.stackexchange.com/questions/1004/mixing-percent-and-fixed-css][1]
Should you ever apply percentage and fixed CSS together? Will it cause problems, and if so what kinds?
* I have heard that mixing can degrade browser render performance?
* I have hard mixing can give you weird results on initial load with progressive rendering browsers?
Below is just a dumbed-down example of mixed usage, it could be any mixture. I am not looking for validation of the example. I have heard you should never do what I have in the example below, so I am trying to find out if using CSS in this manor is an issue.
**Example:**
<style>
.container
{
width:300px;
}
.cell
{
width:25%;
}
</style>
<table class="container">
<tr>
<td class="cell"><td>
<td class="cell"><td>
<td class="cell"><td>
<td class="cell"><td>
</tr>
</table>
[1]: http://ui.stackexchange.com/questions/1004/mixing-percent-and-fixed-css | css | performance | browser | browser-compatibility | null | null | open | Mixing percent and fixed CSS
===
This is a duplicate from UI.StackExchange.com, apparently it didn't belong there: <br/>
[http://ui.stackexchange.com/questions/1004/mixing-percent-and-fixed-css][1]
Should you ever apply percentage and fixed CSS together? Will it cause problems, and if so what kinds?
* I have heard that mixing can degrade browser render performance?
* I have hard mixing can give you weird results on initial load with progressive rendering browsers?
Below is just a dumbed-down example of mixed usage, it could be any mixture. I am not looking for validation of the example. I have heard you should never do what I have in the example below, so I am trying to find out if using CSS in this manor is an issue.
**Example:**
<style>
.container
{
width:300px;
}
.cell
{
width:25%;
}
</style>
<table class="container">
<tr>
<td class="cell"><td>
<td class="cell"><td>
<td class="cell"><td>
<td class="cell"><td>
</tr>
</table>
[1]: http://ui.stackexchange.com/questions/1004/mixing-percent-and-fixed-css | 0 |
8,747,210 | 01/05/2012 17:50:36 | 1,132,755 | 01/05/2012 17:41:49 | 1 | 0 | Updating script to find a new type of file | I need to update the script shown below to find a new file type and naming system and have no idea what I'm doing. It use to pull a file named "DQXXXXX1.eps" and placed in the listed location. The new files are "XXXXX_random.pdf. The random in the file name is several series of numbers that change for each file. The important numbers are the first 5, I would like the script to pull all files in that initial location and place into the other location.
The current script is:
set DQfolder to alias "Prepress:ArtFiles:00-Logos A to Z:1-DQ:"
tell application "Finder"
display dialog "enter number" default answer ""
set theNum to text returned of result as string
--try
move alias (DQfolder & "DQ" & theNum & ".eps" as string) to "Macintosh HD:__DQ Incoming:" with replacing
--on error {}
--move alias (DQfolder & "DQ" & theNum & ".tif") to "Macintosh HD:__DQ Incoming:" with replacing
--end try
end tell | script | apple | null | null | null | null | open | Updating script to find a new type of file
===
I need to update the script shown below to find a new file type and naming system and have no idea what I'm doing. It use to pull a file named "DQXXXXX1.eps" and placed in the listed location. The new files are "XXXXX_random.pdf. The random in the file name is several series of numbers that change for each file. The important numbers are the first 5, I would like the script to pull all files in that initial location and place into the other location.
The current script is:
set DQfolder to alias "Prepress:ArtFiles:00-Logos A to Z:1-DQ:"
tell application "Finder"
display dialog "enter number" default answer ""
set theNum to text returned of result as string
--try
move alias (DQfolder & "DQ" & theNum & ".eps" as string) to "Macintosh HD:__DQ Incoming:" with replacing
--on error {}
--move alias (DQfolder & "DQ" & theNum & ".tif") to "Macintosh HD:__DQ Incoming:" with replacing
--end try
end tell | 0 |
5,910,569 | 05/06/2011 11:13:09 | 533,524 | 12/07/2010 10:32:31 | 34 | 1 | MySQL join with multiple ranges in 'WHERE' clause | I am trying to use snort's schema and extract information relevant to my program.
I use the following query to extract alerts that have happened over a specified period of time for a given set of IPs.The query is something like
select event.sid,event.cid,event.signature,event.timestamp,iphdr.ip_proto,iphdr.ip_src,iphdr.ip_dst from
event join iphdr
where event.sid=iphdr.sid and event.cid=iphdr.cid and iphdr.ip_dst >= inet_aton('x.x.x.1') and iphdr.ip_dst <= inet_aton('x.x.x.255')
or iphdr.ip_dst >= inet_aton('x.x.y.1') and iphdr.ip_dst <= inet_aton('x.x.y.255')
and event.timestamp > "2011-05-06 00:00:00" order by timestamp
Where I need to get the alerts that occur after specified time (06-May-2011) for two sets of IPs (x.x.x.0/24 and x.x.y.0/24)
Execution of the query for ONLY ONE set of IPs (say 192.168.1.0/24) (i.e. between 192.168.1.1 and 192.168.1.255) is fast and easy
The problem happens if there are multiple ranges in WHERE clause. E.g. IPs between 192.168.1.1 and 192.168.1.255 OR between 10.21.18.1 and 10.21.18.255. As given in query above
In such a case, the execution of the mysql query takes long time to execute (I ran it for 30 minutes and then had to kill MySQL daemon)
I am sure it is the OR part that is causing the problem but don't know how to rectify it.
Both the event and iphdr tables have approx. 150,000 rows in all
Since in my program the user may specify multiple subnets for which he wants to see the alerts, I need the query to run seamlessly irrespective of the number of ranges in WHERE clause. | mysql | join | where-clause | null | null | null | open | MySQL join with multiple ranges in 'WHERE' clause
===
I am trying to use snort's schema and extract information relevant to my program.
I use the following query to extract alerts that have happened over a specified period of time for a given set of IPs.The query is something like
select event.sid,event.cid,event.signature,event.timestamp,iphdr.ip_proto,iphdr.ip_src,iphdr.ip_dst from
event join iphdr
where event.sid=iphdr.sid and event.cid=iphdr.cid and iphdr.ip_dst >= inet_aton('x.x.x.1') and iphdr.ip_dst <= inet_aton('x.x.x.255')
or iphdr.ip_dst >= inet_aton('x.x.y.1') and iphdr.ip_dst <= inet_aton('x.x.y.255')
and event.timestamp > "2011-05-06 00:00:00" order by timestamp
Where I need to get the alerts that occur after specified time (06-May-2011) for two sets of IPs (x.x.x.0/24 and x.x.y.0/24)
Execution of the query for ONLY ONE set of IPs (say 192.168.1.0/24) (i.e. between 192.168.1.1 and 192.168.1.255) is fast and easy
The problem happens if there are multiple ranges in WHERE clause. E.g. IPs between 192.168.1.1 and 192.168.1.255 OR between 10.21.18.1 and 10.21.18.255. As given in query above
In such a case, the execution of the mysql query takes long time to execute (I ran it for 30 minutes and then had to kill MySQL daemon)
I am sure it is the OR part that is causing the problem but don't know how to rectify it.
Both the event and iphdr tables have approx. 150,000 rows in all
Since in my program the user may specify multiple subnets for which he wants to see the alerts, I need the query to run seamlessly irrespective of the number of ranges in WHERE clause. | 0 |
6,722,086 | 07/17/2011 05:27:06 | 159,072 | 06/02/2009 18:25:22 | 2,320 | 41 | Postfix to Infix expression conversion algorithm. | Can anyone provide me with any resource relating to Postfix to Infix expression conversion algorithm?
Examples would be much helpful. | algorithm | postfix-notation | null | null | null | 07/17/2011 06:19:01 | not a real question | Postfix to Infix expression conversion algorithm.
===
Can anyone provide me with any resource relating to Postfix to Infix expression conversion algorithm?
Examples would be much helpful. | 1 |
4,049,774 | 10/29/2010 07:17:53 | 467,780 | 10/06/2010 09:28:14 | 14 | 0 | Screen ON/OFF receivers on a service and battery life | I'm new to Android and Java programming so I would like to clear up couple of things.
I've wrote a background service that every 10 seconds it verifies something and based on some conditions it executes something or not. This is implemented using a Timer.
My understanding until now is that the timer in the service will run even when the screen is off.
So every 10 seconds even with the screen off the timer will fire up. I suppose that this will have an impact (don't know how much or how to measure this) on battery life.
Now... I don't need the service to do anything while the screen is off, so I'm thinking to register the Screen OFF and Screen ON broadcast Intents, and on screen OFF to stop the timer (or better to stop the hole service?) and on screen ON to start the timer (or the service).
All these because I believe that in this way my application/service will consume not so much of the battery's life.
Please tell me if my logic is fine, if I'm wrong in some ways or if there are better ways to achieve this.
Thank you! | android | service | screen | battery | off | null | open | Screen ON/OFF receivers on a service and battery life
===
I'm new to Android and Java programming so I would like to clear up couple of things.
I've wrote a background service that every 10 seconds it verifies something and based on some conditions it executes something or not. This is implemented using a Timer.
My understanding until now is that the timer in the service will run even when the screen is off.
So every 10 seconds even with the screen off the timer will fire up. I suppose that this will have an impact (don't know how much or how to measure this) on battery life.
Now... I don't need the service to do anything while the screen is off, so I'm thinking to register the Screen OFF and Screen ON broadcast Intents, and on screen OFF to stop the timer (or better to stop the hole service?) and on screen ON to start the timer (or the service).
All these because I believe that in this way my application/service will consume not so much of the battery's life.
Please tell me if my logic is fine, if I'm wrong in some ways or if there are better ways to achieve this.
Thank you! | 0 |
4,650,235 | 01/10/2011 18:45:42 | 752,665 | 01/05/2011 20:25:14 | 1 | 3 | how to escape "@" in the username when logging in through FTPES with curl? | MY question is based on this:
http://stackoverflow.com/questions/4641424/automaticly-upload-to-ftps/4649521#4649521
what can i do, if i have a "@" in my username?
how could i "escape" that "@"? :\
thank you!
p.s.: sorry for posting, but it's important :\ | curl | openwrt | null | null | null | 01/13/2011 15:41:38 | off topic | how to escape "@" in the username when logging in through FTPES with curl?
===
MY question is based on this:
http://stackoverflow.com/questions/4641424/automaticly-upload-to-ftps/4649521#4649521
what can i do, if i have a "@" in my username?
how could i "escape" that "@"? :\
thank you!
p.s.: sorry for posting, but it's important :\ | 2 |
11,012,986 | 06/13/2012 10:30:04 | 1,453,386 | 01/27/2011 03:32:36 | 1 | 0 | CSS styles for arranging DIVs | I have several DIV which I want to arrange as shown here [Div Layout design ][1]
Below is the HTML that I tried to achieve layout using CSS:
<body>
<div class="page">
<div>
<div style="margin: 2px 0 2px 0px; text-align: center; font-size: large">
<span>Chart Title</span>
</div>
<div style="float: left;display:block;">
<span>Y-Axis Title</span>
</div>
<div id="Chart1">
<!--Chart would be displayed here-->
</div>
<div style="clear:both; margin: 2px 0 2px 0px; text-align: center; ">
<span>X-Axis Title</span>
</div>
</div>
</div>
</body>
Can anyone help me out in CSS to achive the layour mentioned in image ??
Thanks in advance.
[1]: https://www.dropbox.com/s/6mc2po14wvibyrn/Chart_Layout.png | html | css | xhtml | null | null | 06/14/2012 17:40:17 | not a real question | CSS styles for arranging DIVs
===
I have several DIV which I want to arrange as shown here [Div Layout design ][1]
Below is the HTML that I tried to achieve layout using CSS:
<body>
<div class="page">
<div>
<div style="margin: 2px 0 2px 0px; text-align: center; font-size: large">
<span>Chart Title</span>
</div>
<div style="float: left;display:block;">
<span>Y-Axis Title</span>
</div>
<div id="Chart1">
<!--Chart would be displayed here-->
</div>
<div style="clear:both; margin: 2px 0 2px 0px; text-align: center; ">
<span>X-Axis Title</span>
</div>
</div>
</div>
</body>
Can anyone help me out in CSS to achive the layour mentioned in image ??
Thanks in advance.
[1]: https://www.dropbox.com/s/6mc2po14wvibyrn/Chart_Layout.png | 1 |
8,068,386 | 11/09/2011 16:44:32 | 339,696 | 05/12/2010 20:07:40 | 59 | 2 | android onclicklistener GUI change | I am having a silly issue with onClickListeners modifying GUI elements. Below I have a radioGroup holding two buttons, an EditText and a Spinner. When the choose_old radio button is selected, I simply wanted to toggle enable/disable between the Spinner and EditText. The variables select_run and new_run_name are both instance variables and are
obtained from my XML files.
select_run = (Spinner)runDialoglayout.findViewById(R.id.run_choice_spinner);
new_run_name = (EditText)runDialoglayout.findViewById(R.id.new_run_name);
RadioButton choose_old = (RadioButton)runDialoglayout.findViewById(R.id.select_old);
RadioButton choose_new = (RadioButton)runDialoglayout.findViewById(R.id.select_new);
choose_old.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
Log.e("ERROR","GOT CLICK");
select_run.setEnabled(true);
new_run_name.setEnabled(false);
}
});
The 'GOT CLICK' message prints but I do not get the desired changes.
Note:
1. In trying solutions, I had wrapped the GUI changes in a handler.post with no effect.
2. If I set to enabled outside the onClickListener, it successfully changes it.
I've no doubt this is something dumb but can't seem to figure out why this is happening | java | android | null | null | null | null | open | android onclicklistener GUI change
===
I am having a silly issue with onClickListeners modifying GUI elements. Below I have a radioGroup holding two buttons, an EditText and a Spinner. When the choose_old radio button is selected, I simply wanted to toggle enable/disable between the Spinner and EditText. The variables select_run and new_run_name are both instance variables and are
obtained from my XML files.
select_run = (Spinner)runDialoglayout.findViewById(R.id.run_choice_spinner);
new_run_name = (EditText)runDialoglayout.findViewById(R.id.new_run_name);
RadioButton choose_old = (RadioButton)runDialoglayout.findViewById(R.id.select_old);
RadioButton choose_new = (RadioButton)runDialoglayout.findViewById(R.id.select_new);
choose_old.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
Log.e("ERROR","GOT CLICK");
select_run.setEnabled(true);
new_run_name.setEnabled(false);
}
});
The 'GOT CLICK' message prints but I do not get the desired changes.
Note:
1. In trying solutions, I had wrapped the GUI changes in a handler.post with no effect.
2. If I set to enabled outside the onClickListener, it successfully changes it.
I've no doubt this is something dumb but can't seem to figure out why this is happening | 0 |
6,989,876 | 08/08/2011 23:39:57 | 884,996 | 08/08/2011 23:39:57 | 1 | 0 | Drupal Form API + Jquery | How to make a group of radio buttons show an image when selected with jquery and Drupal 7 Form API.
I know about jquery show/hide, but I don't know how to integrate it with drupal form API. | jquery | image | forms | drupal | null | 12/07/2011 14:49:48 | off topic | Drupal Form API + Jquery
===
How to make a group of radio buttons show an image when selected with jquery and Drupal 7 Form API.
I know about jquery show/hide, but I don't know how to integrate it with drupal form API. | 2 |
8,749,340 | 01/05/2012 20:30:28 | 32,771 | 10/30/2008 14:12:54 | 1,921 | 79 | Issue serving PDF files to Google Chrome | I have a Flex application that generates PDF files, and because it's a web application, it sends the PDF up to a web service which sends the file back in a format that users can save. It's worked fine for a while, but it recently began failing in google chrome (and only in chrome). Is there a reason why this code would fail to open a PDF if it has been passed valid PDF data in the input stream?
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Print : System.Web.Services.WebService
{
[WebMethod]
public string PrintPDF()
{
HttpRequest request = HttpContext.Current.Request;
HttpResponse response = HttpContext.Current.Response;
string requestMethod = request.Params["method"];
string requestFilename = request.Params["name"];
if(!validateRequest(request))
{
throw new ArgumentException(String.Format("Error downloading file named '{0}' using disposition '{1}'", requestFilename, requestMethod));
}
response.AddHeader("Content-Disposition", "attachment; filename=\"" + requestFilename + "\"");
byte[] pdf = new byte[request.InputStream.Length];
request.InputStream.Read(pdf, 0, (int)request.InputStream.Length);
response.ContentType = "application/pdf";
response.OutputStream.Write(pdf, 0, (int)request.InputStream.Length);
response.Flush();
response.End();
return "Fail";
}
private bool validateRequest(HttpRequest request)
{
string requestMethod = request.Params["method"];
string requestFilename = request.Params["name"];
Regex cleanFileName = new Regex("[a-zA-Z0-9\\._-]{1, 255}\\.[a-zA-Z0-9]{1, 3}");
return (requestMethod == "attachment" || requestMethod == "inline") &&
cleanFileName.Match(requestFilename) != null;
}
}
| c# | asp.net | flex | google-chrome | alivepdf | null | open | Issue serving PDF files to Google Chrome
===
I have a Flex application that generates PDF files, and because it's a web application, it sends the PDF up to a web service which sends the file back in a format that users can save. It's worked fine for a while, but it recently began failing in google chrome (and only in chrome). Is there a reason why this code would fail to open a PDF if it has been passed valid PDF data in the input stream?
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Print : System.Web.Services.WebService
{
[WebMethod]
public string PrintPDF()
{
HttpRequest request = HttpContext.Current.Request;
HttpResponse response = HttpContext.Current.Response;
string requestMethod = request.Params["method"];
string requestFilename = request.Params["name"];
if(!validateRequest(request))
{
throw new ArgumentException(String.Format("Error downloading file named '{0}' using disposition '{1}'", requestFilename, requestMethod));
}
response.AddHeader("Content-Disposition", "attachment; filename=\"" + requestFilename + "\"");
byte[] pdf = new byte[request.InputStream.Length];
request.InputStream.Read(pdf, 0, (int)request.InputStream.Length);
response.ContentType = "application/pdf";
response.OutputStream.Write(pdf, 0, (int)request.InputStream.Length);
response.Flush();
response.End();
return "Fail";
}
private bool validateRequest(HttpRequest request)
{
string requestMethod = request.Params["method"];
string requestFilename = request.Params["name"];
Regex cleanFileName = new Regex("[a-zA-Z0-9\\._-]{1, 255}\\.[a-zA-Z0-9]{1, 3}");
return (requestMethod == "attachment" || requestMethod == "inline") &&
cleanFileName.Match(requestFilename) != null;
}
}
| 0 |
11,480,524 | 07/14/2012 02:23:20 | 1,062,933 | 11/23/2011 23:14:07 | 173 | 12 | How may I use the StackExchange QA editor in my own website template? | I've been using elrte js library to edit users personal profiles in a web site I made for artists database, but I kind don't like it because users complain about it's complexity and stability.
I like very much of this question/answer editor from StackOverflow and I's like to know if I can borrow the code for using in this website or it's copyrighted. If it's ok, where can I download the proper source-code? | javascript | html | css | text-editor | stackoverflow.com | 07/15/2012 11:53:08 | off topic | How may I use the StackExchange QA editor in my own website template?
===
I've been using elrte js library to edit users personal profiles in a web site I made for artists database, but I kind don't like it because users complain about it's complexity and stability.
I like very much of this question/answer editor from StackOverflow and I's like to know if I can borrow the code for using in this website or it's copyrighted. If it's ok, where can I download the proper source-code? | 2 |
1,348,126 | 08/28/2009 16:32:25 | 155,387 | 08/12/2009 20:16:14 | 21 | 1 | Modify all tables at once in Postgres DB | How do I modify all tables in a Postgres database to change the owner?
I tried ALTER TABLE * OWNER TO new_owner but it doesn't like the star. | postgresql | null | null | null | null | null | open | Modify all tables at once in Postgres DB
===
How do I modify all tables in a Postgres database to change the owner?
I tried ALTER TABLE * OWNER TO new_owner but it doesn't like the star. | 0 |
374,147 | 12/17/2008 10:13:56 | 15,124 | 09/17/2008 06:17:51 | 4,878 | 292 | What is Boost missing? | After spending most of my waking time on SO, for better or for worse, I've come to notice how
99% of the C++ questions are answered with "use boost::wealreadysolvedyourproblem", but there must definitely be a few areas Boost doesn't cover, but would be better if it did.
So what features is boost missing?
I'll start by saying:
- **boost::sql** (although <a href="http://soci.sourceforge.net/">SOCI</a> should try to become a legal part of boost)
- **boost::json** (although <a href="http://blog.beef.de/projects/tinyjson/">TinyJSON</a> should try to become a legal part of boost)
- **boost::audio** (no idea about a good boost-like C++ library)
-----------
*PS: The purpose is to compile a reasonable list, and hopefully boost-like solutions out there that aren't yet a part of boost, so no silly stuff like **boost::turkey** please* | c++ | boost | null | null | null | 05/08/2012 23:01:02 | not constructive | What is Boost missing?
===
After spending most of my waking time on SO, for better or for worse, I've come to notice how
99% of the C++ questions are answered with "use boost::wealreadysolvedyourproblem", but there must definitely be a few areas Boost doesn't cover, but would be better if it did.
So what features is boost missing?
I'll start by saying:
- **boost::sql** (although <a href="http://soci.sourceforge.net/">SOCI</a> should try to become a legal part of boost)
- **boost::json** (although <a href="http://blog.beef.de/projects/tinyjson/">TinyJSON</a> should try to become a legal part of boost)
- **boost::audio** (no idea about a good boost-like C++ library)
-----------
*PS: The purpose is to compile a reasonable list, and hopefully boost-like solutions out there that aren't yet a part of boost, so no silly stuff like **boost::turkey** please* | 4 |
5,150,393 | 03/01/2011 04:14:50 | 628,084 | 02/22/2011 09:56:36 | 6 | 0 | How to split a no in c#? | how to split this 000012120 this number will be changed. some time no will be 00012200
will be help me to split this no | c# | .net | asp.net | null | null | 03/01/2011 04:20:18 | not a real question | How to split a no in c#?
===
how to split this 000012120 this number will be changed. some time no will be 00012200
will be help me to split this no | 1 |
4,025,298 | 10/26/2010 15:35:40 | 237,743 | 12/23/2009 16:46:58 | 1,068 | 51 | XML and XSLT to generate CSS ? | I want to provide user facility to change the CSS.
1. First think clicked is that storing CSS as XML will help me read CSS and understand.
2. Second is that using XSLT i will be able to generate the CSS (am i right ? will that be useful)
3. Lastly when user changed the CSS XML file can be updated and then it can be used.
Now this is at very rough level ..... i am using ASP.NET can some one please guide me if my understanding is correct or not and how should i approach for this pros/cons.
Will something like below will work ? is possible?
<link src="someserverfiletoprocessxmlusingxslt.aspx?user=id" type=text/css/> | asp.net | design | null | null | null | null | open | XML and XSLT to generate CSS ?
===
I want to provide user facility to change the CSS.
1. First think clicked is that storing CSS as XML will help me read CSS and understand.
2. Second is that using XSLT i will be able to generate the CSS (am i right ? will that be useful)
3. Lastly when user changed the CSS XML file can be updated and then it can be used.
Now this is at very rough level ..... i am using ASP.NET can some one please guide me if my understanding is correct or not and how should i approach for this pros/cons.
Will something like below will work ? is possible?
<link src="someserverfiletoprocessxmlusingxslt.aspx?user=id" type=text/css/> | 0 |
9,756,993 | 03/18/2012 08:22:48 | 1,276,654 | 03/18/2012 08:02:06 | 1 | 0 | Recent Activity Plugin, Working with an Office 365 website | I am trying to load a recent activity plugin on to my website which is built using the microsoft 365 template. this has been forced upon me as microsoft are closing the free earlier version called microsoft office live small business. I have had to rebuild my site from scratch.
On my OLSB site the plugin worked great it was a really good tool enabling me to upload straight to my site via facebook from my phone.
I have tried the same instructions for the 365 site but it just doesn't work, I can get the frame on the page but it just says "no recent activity" or if I change a few things it just shows a generic FB activity
Any help or similar experiences would be of great help
Thanks
Clive | facebook-social-plugins | iframe-app | null | null | null | null | open | Recent Activity Plugin, Working with an Office 365 website
===
I am trying to load a recent activity plugin on to my website which is built using the microsoft 365 template. this has been forced upon me as microsoft are closing the free earlier version called microsoft office live small business. I have had to rebuild my site from scratch.
On my OLSB site the plugin worked great it was a really good tool enabling me to upload straight to my site via facebook from my phone.
I have tried the same instructions for the 365 site but it just doesn't work, I can get the frame on the page but it just says "no recent activity" or if I change a few things it just shows a generic FB activity
Any help or similar experiences would be of great help
Thanks
Clive | 0 |
8,969,800 | 01/23/2012 09:56:27 | 873,416 | 08/01/2011 20:06:03 | 30 | 1 | Functional automated testing python | Please suggest me best opens source or free automated functional testing tool for desktop application developed in python (Qt, Pyside). | python | automated-tests | desktop-application | pyside | null | 01/24/2012 13:33:50 | not constructive | Functional automated testing python
===
Please suggest me best opens source or free automated functional testing tool for desktop application developed in python (Qt, Pyside). | 4 |
11,557,789 | 07/19/2012 09:27:35 | 501,254 | 11/08/2010 22:33:45 | 162 | 8 | High Performance Javascript Collections (Collection<T>) | I'm planning to use knockout.js for my next project. But I need javascript equivalent of c# Collection<T> .
-Add
-Remove
-Contains
I have two criterias for this requirement.
- Production Ready
- Good Performance
| javascript | collections | knockout.js | null | null | 07/20/2012 00:35:41 | not constructive | High Performance Javascript Collections (Collection<T>)
===
I'm planning to use knockout.js for my next project. But I need javascript equivalent of c# Collection<T> .
-Add
-Remove
-Contains
I have two criterias for this requirement.
- Production Ready
- Good Performance
| 4 |
3,535,037 | 08/20/2010 21:32:46 | 420,556 | 08/14/2010 18:33:35 | 17 | 0 | Split and Swap String in Objective C (iPhone) | Hi I have an array of strings separated with a delimeter ":". I tried separating strings using componentsSeparatedByString method and then save the result into an array and later use that array to produce the desired output, but it didn't worked.
For example
Now my UITableView displays cells as:
**Case 1:**
How:Many
Too:Many
Apple:Milk
iPhone:Simulator
I want the cells to be displayed on UITableView as:
**Case 2:**
Many How
Many Too
Milk Apple
Simulator iPhone
This is my cellForRowAtIndexPath method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSString *entry=[entryKeys objectAtIndex:[indexPath section]];
NSArray *entrySection=[entries objectForKey:entry];
cell.textLabel.text=[entrySection objectAtIndex:[indexPath row]]
}
return cell;
}
The output of the above method is **case 1** but I want the output to be **case 2**
entryKeys has keys from A-Z and entry section has values sorted and listed for respective keys i.e. entries starting with A grouped under key A so on...
It may sound silly but I am still learning..please help me | iphone | objective-c | uitableview | nsstring | objective | null | open | Split and Swap String in Objective C (iPhone)
===
Hi I have an array of strings separated with a delimeter ":". I tried separating strings using componentsSeparatedByString method and then save the result into an array and later use that array to produce the desired output, but it didn't worked.
For example
Now my UITableView displays cells as:
**Case 1:**
How:Many
Too:Many
Apple:Milk
iPhone:Simulator
I want the cells to be displayed on UITableView as:
**Case 2:**
Many How
Many Too
Milk Apple
Simulator iPhone
This is my cellForRowAtIndexPath method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSString *entry=[entryKeys objectAtIndex:[indexPath section]];
NSArray *entrySection=[entries objectForKey:entry];
cell.textLabel.text=[entrySection objectAtIndex:[indexPath row]]
}
return cell;
}
The output of the above method is **case 1** but I want the output to be **case 2**
entryKeys has keys from A-Z and entry section has values sorted and listed for respective keys i.e. entries starting with A grouped under key A so on...
It may sound silly but I am still learning..please help me | 0 |
10,064,910 | 04/08/2012 17:43:19 | 1,320,578 | 04/08/2012 17:37:05 | 1 | 0 | Need a code/JAR/API | Is there any JAVA API/JAR files available to convert a boolean expression to boolean circuit.....
I search on net , but I am unable to find it, so can you please help to provide this API or a place/location where I can find them.... | java | jar | null | null | null | 04/09/2012 10:27:41 | not a real question | Need a code/JAR/API
===
Is there any JAVA API/JAR files available to convert a boolean expression to boolean circuit.....
I search on net , but I am unable to find it, so can you please help to provide this API or a place/location where I can find them.... | 1 |
4,488,255 | 12/20/2010 09:16:54 | 548,418 | 12/20/2010 09:16:54 | 1 | 0 | python - how to create a subprocess? |
I want to create a subprocess of a process.
how can i do that?
please giv me example
| python | process | null | null | null | null | open | python - how to create a subprocess?
===
I want to create a subprocess of a process.
how can i do that?
please giv me example
| 0 |
4,742,960 | 01/20/2011 02:36:31 | 501,304 | 11/08/2010 23:57:32 | 3 | 0 | DataGridView Validation & Changing Cell Value | I would like to manipulate a cell in my DataGridView when it is validating so that if the user enters a value that is not valid for the database, but is easily converted to valid data, the program will change the value to an appropriate one.
I am able to validate my value properly but when I try to change it to something valid I get a DataError. Here is my code:
private void unit_List_2_GroupsDataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
Console.WriteLine("Validating");
DataGridViewColumn col = this.unit_List_2_GroupsDataGridView.Columns[e.ColumnIndex];
DataGridViewCell cell = this.unit_List_2_GroupsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (col == this.batchDataGridViewTextBoxColumn && this.unit_List_2_GroupsDataGridView.IsCurrentCellInEditMode)
{
Console.WriteLine(" Batch Column");
DataRow[] rows = label_EntryDataSet.viewJobBatchList.Select(String.Format("Job={0} AND Display='{1}'"
, comboBox1.SelectedValue, e.FormattedValue));
if (rows.Length == 1)
{
Console.WriteLine(" Auto Completed item from list: {0}", rows[0]["Batch"]);
//e.Cancel = true;
cell.Value = rows[0]["Batch"];
//this.unit_List_2_GroupsDataGridView.EndEdit();
}
else
{
Console.WriteLine(" No Autocomplete!");
int i = 0;
if (!int.TryParse(e.FormattedValue.ToString(), out i))
{
Console.WriteLine(" Not an integer either");
e.Cancel = true;
}
}
}
}
The line that reads **cell.Value = rows[0]["Batch"];** is not doing what I expect it to do. | c# | datagridview | validating | null | null | null | open | DataGridView Validation & Changing Cell Value
===
I would like to manipulate a cell in my DataGridView when it is validating so that if the user enters a value that is not valid for the database, but is easily converted to valid data, the program will change the value to an appropriate one.
I am able to validate my value properly but when I try to change it to something valid I get a DataError. Here is my code:
private void unit_List_2_GroupsDataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
Console.WriteLine("Validating");
DataGridViewColumn col = this.unit_List_2_GroupsDataGridView.Columns[e.ColumnIndex];
DataGridViewCell cell = this.unit_List_2_GroupsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (col == this.batchDataGridViewTextBoxColumn && this.unit_List_2_GroupsDataGridView.IsCurrentCellInEditMode)
{
Console.WriteLine(" Batch Column");
DataRow[] rows = label_EntryDataSet.viewJobBatchList.Select(String.Format("Job={0} AND Display='{1}'"
, comboBox1.SelectedValue, e.FormattedValue));
if (rows.Length == 1)
{
Console.WriteLine(" Auto Completed item from list: {0}", rows[0]["Batch"]);
//e.Cancel = true;
cell.Value = rows[0]["Batch"];
//this.unit_List_2_GroupsDataGridView.EndEdit();
}
else
{
Console.WriteLine(" No Autocomplete!");
int i = 0;
if (!int.TryParse(e.FormattedValue.ToString(), out i))
{
Console.WriteLine(" Not an integer either");
e.Cancel = true;
}
}
}
}
The line that reads **cell.Value = rows[0]["Batch"];** is not doing what I expect it to do. | 0 |
10,366,888 | 04/28/2012 19:37:59 | 991,365 | 10/12/2011 11:45:38 | 1 | 0 | only show first # words, using jquery | i have a problem. i load some text from the db. On my page, i only want to show 30 first words of this text. I will then add a 'read more' button, which will redirect the user to a new page. So the 'jquery expander plugin', which will show the remaining text in the same div, will not work for me I think.
i got this far:
$content = $("#blog_1").find(".entryContent").text().split(" ");
$slicedContent = $content.slice(30);
I have been messing around with .split and .slice for hours. But no success.
I don't even have to 'keep' the remainder of the text, since it will be loaded again when the user will click read more, on the 'detail page'. So onwards from word 30, the text could be removed from the DOM.
answers regarding displaying a set number of characters instead of words are also helpful.
Thanks in advace! | split | slice | null | null | null | null | open | only show first # words, using jquery
===
i have a problem. i load some text from the db. On my page, i only want to show 30 first words of this text. I will then add a 'read more' button, which will redirect the user to a new page. So the 'jquery expander plugin', which will show the remaining text in the same div, will not work for me I think.
i got this far:
$content = $("#blog_1").find(".entryContent").text().split(" ");
$slicedContent = $content.slice(30);
I have been messing around with .split and .slice for hours. But no success.
I don't even have to 'keep' the remainder of the text, since it will be loaded again when the user will click read more, on the 'detail page'. So onwards from word 30, the text could be removed from the DOM.
answers regarding displaying a set number of characters instead of words are also helpful.
Thanks in advace! | 0 |
9,083,258 | 01/31/2012 16:37:04 | 979,563 | 10/05/2011 01:45:30 | 74 | 1 | Wordpress Contact Form Hack | I'm trying to clean up a small hack on my Wordpress site. It's located at http://www.mydermakare.com. I found the initial spam code in the index.php file and deleted it, but I'm still getting a function session-start error at the top of my page.
Any ideas on where I can find the problem code?
| php | wordpress | spam | hack | null | 02/01/2012 16:01:44 | not a real question | Wordpress Contact Form Hack
===
I'm trying to clean up a small hack on my Wordpress site. It's located at http://www.mydermakare.com. I found the initial spam code in the index.php file and deleted it, but I'm still getting a function session-start error at the top of my page.
Any ideas on where I can find the problem code?
| 1 |
2,031,381 | 01/08/2010 22:59:29 | 99,045 | 04/30/2009 23:42:52 | 296 | 3 | Web Proxy in c# | I need to implement a basic web proxy in c#. Initial investigation it seems like it could be a tricky area. Does anyone have pointers to starting points, resources or open source implementations? | c# | webproxy | null | null | null | null | open | Web Proxy in c#
===
I need to implement a basic web proxy in c#. Initial investigation it seems like it could be a tricky area. Does anyone have pointers to starting points, resources or open source implementations? | 0 |
6,882,364 | 07/30/2011 09:47:26 | 870,526 | 07/30/2011 09:47:26 | 1 | 0 | Remote Method Invocation in Android | I would like to know about the procedure of Remote Method Invocation in Android.
Thanks | android | null | null | null | null | 07/31/2011 14:02:21 | not a real question | Remote Method Invocation in Android
===
I would like to know about the procedure of Remote Method Invocation in Android.
Thanks | 1 |
181,147 | 10/08/2008 02:32:38 | 6,616 | 09/15/2008 12:22:17 | 21 | 2 | WinForms: Load localized help (chm) files | What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, and I'd definitely like to avoid writing my own searching algorithm, because for example, I'd have to handle specific cases such as "zh-CN/zh-Hans/zh-CHS".
I can't find anything with the System.Windows.Forms.Help class that indicates that you can provide a CultureInfo object to specify a particular culture. Anybody else run across this yet?
Thanks! | winforms | chm | localization | null | null | null | open | WinForms: Load localized help (chm) files
===
What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, and I'd definitely like to avoid writing my own searching algorithm, because for example, I'd have to handle specific cases such as "zh-CN/zh-Hans/zh-CHS".
I can't find anything with the System.Windows.Forms.Help class that indicates that you can provide a CultureInfo object to specify a particular culture. Anybody else run across this yet?
Thanks! | 0 |
7,285,794 | 09/02/2011 15:33:12 | 855,698 | 07/21/2011 10:21:18 | 1 | 0 | How to customise the Camera screen frame? | I want to lauch camera with customised frame so that I should be able to show `UIsearchBar` in the same View and on touching the `UISearchBar` I need to close the camera, but the `UIsearchBar` should be visible.
So I want to know how to customise the Camera Screen? | iphone | camera | camera-overlay | null | null | null | open | How to customise the Camera screen frame?
===
I want to lauch camera with customised frame so that I should be able to show `UIsearchBar` in the same View and on touching the `UISearchBar` I need to close the camera, but the `UIsearchBar` should be visible.
So I want to know how to customise the Camera Screen? | 0 |
508,208 | 02/03/2009 17:59:29 | 609 | 08/07/2008 10:26:12 | 463 | 14 | What is the impact of Thread.Sleep(1) in C#? | In a windows form application what is the impact of calling `Thread.Sleep(1)` as illustrated in the following code:
public Constructor()
{
Thread thread = new Thread(Task);
thread.IsBackground = true;
thread.Start();
}
private void Task()
{
while (true)
{
// do something
Thread.Sleep(1);
}
}
Will this thread hog all of the available CPU?
What profiling techniques can I use to measure this Thread's CPU usage ( other than task manager )?
| c# | multithreading | null | null | null | null | open | What is the impact of Thread.Sleep(1) in C#?
===
In a windows form application what is the impact of calling `Thread.Sleep(1)` as illustrated in the following code:
public Constructor()
{
Thread thread = new Thread(Task);
thread.IsBackground = true;
thread.Start();
}
private void Task()
{
while (true)
{
// do something
Thread.Sleep(1);
}
}
Will this thread hog all of the available CPU?
What profiling techniques can I use to measure this Thread's CPU usage ( other than task manager )?
| 0 |
1,860,363 | 12/07/2009 14:38:21 | 36,330 | 11/10/2008 20:40:21 | 4,033 | 134 | How do I distinguish "module not found" from "module threw exception" on ImportError? | In Python, `import does_not_exist` raises `ImportError`, and
import exists
`exists.py`:
import does_not_exist
will also raise `ImportError`.
How should I tell the difference in code? | python | importerror | null | null | null | null | open | How do I distinguish "module not found" from "module threw exception" on ImportError?
===
In Python, `import does_not_exist` raises `ImportError`, and
import exists
`exists.py`:
import does_not_exist
will also raise `ImportError`.
How should I tell the difference in code? | 0 |
2,702,257 | 04/23/2010 22:07:39 | 233,971 | 12/17/2009 17:08:48 | 107 | 0 | php.ini not being read with windows 7 installation | I have installed php successfully on a Windows 7 machine but I can not for the life of me get it to read the php.ini file.
I have uncommented out the line for php to use mysql and when I run phpinfo(), it never shows up.
I have checked to make sure there is only one php.ini file on my entire c:\ drive and it's sitting in my c:\windows folder.
has anyone else run into this and know of a solution to get php to read the .ini so that I can enable some extensions (mysql etc)? | php.ini | windows-7 | iis7 | null | null | null | open | php.ini not being read with windows 7 installation
===
I have installed php successfully on a Windows 7 machine but I can not for the life of me get it to read the php.ini file.
I have uncommented out the line for php to use mysql and when I run phpinfo(), it never shows up.
I have checked to make sure there is only one php.ini file on my entire c:\ drive and it's sitting in my c:\windows folder.
has anyone else run into this and know of a solution to get php to read the .ini so that I can enable some extensions (mysql etc)? | 0 |
8,357,913 | 12/02/2011 14:36:41 | 183,339 | 10/02/2009 20:40:36 | 3,358 | 132 | Translations of common application strings | *Ok, quick points for someone who is better at searching than I am...*
I **know** I have seen before a list of translations of common application strings like "File," "Open," "Save," "Close," and "OK," into other languages. This was not just a scrape of Google translator, but an actual "official" list based on the localized OS. It seems to me that it was on Microsoft's site, but I'm not 100% sure.
I need to translate my application into Indonesian and wanted to give our translators a head start by filling in those common terms with the standard values, but now I cannot find the web page(s)! I've spent about 15 minutes and will continue to search (and will post the answer if I find it), but if someone else knows where that is (or finds it first!), please answer. | localization | null | null | null | null | 12/02/2011 19:15:29 | not a real question | Translations of common application strings
===
*Ok, quick points for someone who is better at searching than I am...*
I **know** I have seen before a list of translations of common application strings like "File," "Open," "Save," "Close," and "OK," into other languages. This was not just a scrape of Google translator, but an actual "official" list based on the localized OS. It seems to me that it was on Microsoft's site, but I'm not 100% sure.
I need to translate my application into Indonesian and wanted to give our translators a head start by filling in those common terms with the standard values, but now I cannot find the web page(s)! I've spent about 15 minutes and will continue to search (and will post the answer if I find it), but if someone else knows where that is (or finds it first!), please answer. | 1 |
11,548,885 | 07/18/2012 19:29:08 | 1,200,302 | 02/09/2012 17:53:28 | 418 | 38 | How to create HTML based on Selected Option | ## The Scenario ##
I have a file, run.phtml, that serves as the view for a report controller within Zend Framework. I didn't write the code, and the code uses a home-built framework that resides on top of Zend to extend it.
There's a report format option list that allows the user to select an HTML table for the results, or an Excel file for downloading.
**We currently must support IE7, IE8, and Firefox.**
If the report format is Excel, we need to use the following for the run button:
onclick="COS.report.updateFormAction(false); document.getElementById('report_param_form').submit();"
If the report format is HTML, we need to use the following for the run button:
onclick="COS.report.render('report_table_div', true);"
## The Problem ##
The code I have currently works, but it's janky, ugly, and cumbersome. It's heavy on jquery syntax for HTML creation. I'd like a better way to accomplish the task that will make it easy for the next guy to figure out.
The problem would go away entirely if it were just Firefox, but I need to use a different onclick event for the button for IE and it's only necessary for if the format type is Excel.
The select option for Excel vs HTML is built using this home-built extension that doesn't allow me to use Zend's built-in form element creator, so I can't just add it to the element.
## HTML ##
<!-- language-all: lang-html -->
<div id='buttons_div'>
[[This is where the run button will go. And the following code needs to be present as well. It currently deletes whatever is in the div, which is why the buttons are concatenated at the end.]]
<input type="button" id="email_report_button" value="Email Results" style="<?php echo $display; ?>" title="Email the results of this report to yourself" onclick="COS.report.email();"> <input type="button" id="clear_report_button" value="Clear" title="Clears the input form and the results box" onclick="COS.report.clear('report_table_div');"> <input type="button" id="cancel_report_button" style="display: none" value="Cancel" title="Cancel the report before the results are returned" onclick="COS.report.cancel();"> <img id="ajax_spinner" style="display: none; text-align: center;" src="/images/modal-load.gif" width="20" height="20"/>
</div>
## jQuery ##
<!-- language: lang-js -->
$j = jQuery.noConflict();
$j("select#report_format").change(function () {
var str = "";
if($j("select#report_format option:selected").val() == "xls")
{
str += "<input type=\"button\" value=\"Preview Excel Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.updateFormAction(true); document.getElementById(\'report_param_form\').submit();\" id=\"preview_report_button\" class=\"btn\"> <input type=\"button\" value=\"Run Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.updateFormAction(false); document.getElementById(\'report_param_form\').submit();\" id=\"run_report_button\" class=\"btn\">";
}
else
{
str += "<input type=\"button\" value=\"Preview HTML Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.render(\'report_table_div\', true);\" id=\"preview_report_button\" class=\"btn\"> <input type=\"button\" value=\"Run Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.render(\'report_table_div\', false);\" id=\"run_report_button\" class=\"btn\">";
}
str += "<input type=\"button\" id=\"email_report_button\" value=\"Email Results\" style=\"<?php echo $display; ?>\" title=\"Email the results of this report to yourself\" onclick=\"COS.report.email();\"> <input type=\"button\" id=\"clear_report_button\" value=\"Clear\" title=\"Clears the input form and the results box\" onclick=\"COS.report.clear(\'report_table_div\');\"> <input type=\"button\" id=\"cancel_report_button\" style=\"display: none\" value=\"Cancel\" title=\"Cancel the report before the results are returned\" onclick=\"COS.report.cancel();\"> <img id=\"ajax_spinner\" style=\"display: none; text-align: center;\" src=\"/images/modal-load.gif\" width=\"20\" height=\"20\"/>";
$j("div#buttons_div").html(str);
})
.change(); | jquery | html | forms | zend-framework | onchange | null | open | How to create HTML based on Selected Option
===
## The Scenario ##
I have a file, run.phtml, that serves as the view for a report controller within Zend Framework. I didn't write the code, and the code uses a home-built framework that resides on top of Zend to extend it.
There's a report format option list that allows the user to select an HTML table for the results, or an Excel file for downloading.
**We currently must support IE7, IE8, and Firefox.**
If the report format is Excel, we need to use the following for the run button:
onclick="COS.report.updateFormAction(false); document.getElementById('report_param_form').submit();"
If the report format is HTML, we need to use the following for the run button:
onclick="COS.report.render('report_table_div', true);"
## The Problem ##
The code I have currently works, but it's janky, ugly, and cumbersome. It's heavy on jquery syntax for HTML creation. I'd like a better way to accomplish the task that will make it easy for the next guy to figure out.
The problem would go away entirely if it were just Firefox, but I need to use a different onclick event for the button for IE and it's only necessary for if the format type is Excel.
The select option for Excel vs HTML is built using this home-built extension that doesn't allow me to use Zend's built-in form element creator, so I can't just add it to the element.
## HTML ##
<!-- language-all: lang-html -->
<div id='buttons_div'>
[[This is where the run button will go. And the following code needs to be present as well. It currently deletes whatever is in the div, which is why the buttons are concatenated at the end.]]
<input type="button" id="email_report_button" value="Email Results" style="<?php echo $display; ?>" title="Email the results of this report to yourself" onclick="COS.report.email();"> <input type="button" id="clear_report_button" value="Clear" title="Clears the input form and the results box" onclick="COS.report.clear('report_table_div');"> <input type="button" id="cancel_report_button" style="display: none" value="Cancel" title="Cancel the report before the results are returned" onclick="COS.report.cancel();"> <img id="ajax_spinner" style="display: none; text-align: center;" src="/images/modal-load.gif" width="20" height="20"/>
</div>
## jQuery ##
<!-- language: lang-js -->
$j = jQuery.noConflict();
$j("select#report_format").change(function () {
var str = "";
if($j("select#report_format option:selected").val() == "xls")
{
str += "<input type=\"button\" value=\"Preview Excel Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.updateFormAction(true); document.getElementById(\'report_param_form\').submit();\" id=\"preview_report_button\" class=\"btn\"> <input type=\"button\" value=\"Run Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.updateFormAction(false); document.getElementById(\'report_param_form\').submit();\" id=\"run_report_button\" class=\"btn\">";
}
else
{
str += "<input type=\"button\" value=\"Preview HTML Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.render(\'report_table_div\', true);\" id=\"preview_report_button\" class=\"btn\"> <input type=\"button\" value=\"Run Report\" title=\"Run the report but limit the results to 10 rows\" onclick=\"COS.report.render(\'report_table_div\', false);\" id=\"run_report_button\" class=\"btn\">";
}
str += "<input type=\"button\" id=\"email_report_button\" value=\"Email Results\" style=\"<?php echo $display; ?>\" title=\"Email the results of this report to yourself\" onclick=\"COS.report.email();\"> <input type=\"button\" id=\"clear_report_button\" value=\"Clear\" title=\"Clears the input form and the results box\" onclick=\"COS.report.clear(\'report_table_div\');\"> <input type=\"button\" id=\"cancel_report_button\" style=\"display: none\" value=\"Cancel\" title=\"Cancel the report before the results are returned\" onclick=\"COS.report.cancel();\"> <img id=\"ajax_spinner\" style=\"display: none; text-align: center;\" src=\"/images/modal-load.gif\" width=\"20\" height=\"20\"/>";
$j("div#buttons_div").html(str);
})
.change(); | 0 |
6,984,006 | 08/08/2011 14:54:12 | 697,074 | 04/07/2011 15:15:37 | 11 | 4 | How to not show Jquery Tooltip if the email has not been taken | I'm currently trying to implement a feature to check if an email has already been taken when a first time user registers for my site. I'm trying to do this with AJAX and use the jQuery tooltip (http://flowplayer.org/tools/tooltip/) plugin to display the message if the e-mail has in fact been taken.
I don't want to display any message if the e-mail is not taken and don't want the user to be aware of the fact that I'm checking their e-mail against the database, when they focus out of the e-mail input box. I only want to display a tooltip message if the e-mail has been taken and then make sure it dissapears if they provide a new unique e-mail address.
Here is my code thus far:
**register.php (where the form is)**
<div class="textboxfrm"><span class="label">Email<span style="color:#FF9000">* </span> </span><span class="left"></span><span class="center"><input class="required validate-email" id="email" name="email" type="text" style="width:230px;" maxlength="50" />
</span>
<div class="tooltip_email"></div>
</div>
**register.js** (loaded on document.ready)
jQuery("span.center").tooltip({
events: {
input: 'onChange, blur',
},
effect: "slide",
delay: 3000,
onBeforeShow: function() {
email = jQuery('#email').attr('value');
if (email.length > 1){
jQuery("#email").blur(function() { // when focus out
jQuery.ajax({
type: "GET",
url: "checkusername.php",
data: "email=" + email,
success: function(data) {
jQuery(".tooltip_email").html(data);
}
}); //end ajax call
//jQuery(".tooltip_email").hide();
});//end email blur
//return false;
}//end if email > 1
else { jQuery("span.center").tooltip.hide(); }
} // end onBeforeShow function
}); //end span.center tooltip
Finally, **checkusername.php** (where the database is accessed)
<?php
$email = $_GET['email'];
// connection settings stored in file
include("connectionParameters.php");
$connection = mysql_connect($host,$user,$pass)
or die ("We're sorry, there seems to be an error. Please try again later.");
mysql_select_db($database);
$email = $_GET['email'];
mysql_select_db("testdatabase", $con);
$sql= sprintf("SELECT * FROM Users WHERE email='%s'", mysql_real_escape_string($email));
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$taken = $row['email'];
if(mysql_num_rows($result) > 0){
echo "<p>This email belongs to a registered user. Please provide a different email address, or visit <a href='forgot_pass.php'>this</a> page to retrieve your password.</p>";
}
else if(mysql_num_rows($result) < 1) { exit(); }
mysql_close($con);
?>
| php | javascript | ajax | null | null | null | open | How to not show Jquery Tooltip if the email has not been taken
===
I'm currently trying to implement a feature to check if an email has already been taken when a first time user registers for my site. I'm trying to do this with AJAX and use the jQuery tooltip (http://flowplayer.org/tools/tooltip/) plugin to display the message if the e-mail has in fact been taken.
I don't want to display any message if the e-mail is not taken and don't want the user to be aware of the fact that I'm checking their e-mail against the database, when they focus out of the e-mail input box. I only want to display a tooltip message if the e-mail has been taken and then make sure it dissapears if they provide a new unique e-mail address.
Here is my code thus far:
**register.php (where the form is)**
<div class="textboxfrm"><span class="label">Email<span style="color:#FF9000">* </span> </span><span class="left"></span><span class="center"><input class="required validate-email" id="email" name="email" type="text" style="width:230px;" maxlength="50" />
</span>
<div class="tooltip_email"></div>
</div>
**register.js** (loaded on document.ready)
jQuery("span.center").tooltip({
events: {
input: 'onChange, blur',
},
effect: "slide",
delay: 3000,
onBeforeShow: function() {
email = jQuery('#email').attr('value');
if (email.length > 1){
jQuery("#email").blur(function() { // when focus out
jQuery.ajax({
type: "GET",
url: "checkusername.php",
data: "email=" + email,
success: function(data) {
jQuery(".tooltip_email").html(data);
}
}); //end ajax call
//jQuery(".tooltip_email").hide();
});//end email blur
//return false;
}//end if email > 1
else { jQuery("span.center").tooltip.hide(); }
} // end onBeforeShow function
}); //end span.center tooltip
Finally, **checkusername.php** (where the database is accessed)
<?php
$email = $_GET['email'];
// connection settings stored in file
include("connectionParameters.php");
$connection = mysql_connect($host,$user,$pass)
or die ("We're sorry, there seems to be an error. Please try again later.");
mysql_select_db($database);
$email = $_GET['email'];
mysql_select_db("testdatabase", $con);
$sql= sprintf("SELECT * FROM Users WHERE email='%s'", mysql_real_escape_string($email));
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$taken = $row['email'];
if(mysql_num_rows($result) > 0){
echo "<p>This email belongs to a registered user. Please provide a different email address, or visit <a href='forgot_pass.php'>this</a> page to retrieve your password.</p>";
}
else if(mysql_num_rows($result) < 1) { exit(); }
mysql_close($con);
?>
| 0 |
10,846,181 | 06/01/2012 07:28:55 | 191,995 | 10/18/2009 12:30:10 | 311 | 5 | How OS scheduler schedules threads that belong to two different processes (tasks)? | As far as all books say switching between tasks/processes is more expensive than switching between threads of the same process/task. If so, then scheduler of threads-aware OS should schedule threads in such way that the threads of the same process/task should be executed next to each other and not interleaved with executions of threads from other processes/tasks.
As I reading books on OSes all books just stop at stating that threads switching is less expensive than process switching. And that's it. No books tells how exactly scheduler is solving problem of avoiding switching between threads of different tasks.
Is my understanding of the problem not correct? Or am I missing something? Why such huge topic of possible performance degrade is not covered in each and every OS books in "Scheduling" chapters? Am I reading wrong books? | multithreading | operating-system | scheduling | multitasking | null | 06/03/2012 09:52:35 | not a real question | How OS scheduler schedules threads that belong to two different processes (tasks)?
===
As far as all books say switching between tasks/processes is more expensive than switching between threads of the same process/task. If so, then scheduler of threads-aware OS should schedule threads in such way that the threads of the same process/task should be executed next to each other and not interleaved with executions of threads from other processes/tasks.
As I reading books on OSes all books just stop at stating that threads switching is less expensive than process switching. And that's it. No books tells how exactly scheduler is solving problem of avoiding switching between threads of different tasks.
Is my understanding of the problem not correct? Or am I missing something? Why such huge topic of possible performance degrade is not covered in each and every OS books in "Scheduling" chapters? Am I reading wrong books? | 1 |
845,241 | 05/10/2009 12:26:10 | 104,348 | 05/10/2009 12:26:10 | 1 | 0 | What is the most convenient way to stop an Ajax-object in prototype from swallowing exceptions? | Consider this code:
new Ajax.Request('?service=example', {
parameters : {tags : 'exceptions'},
onSuccess : this.dataReceived.bind(this)
});
If an exception occurs anywhere in the dataReceived-function when it is called by the Ajax-object, it is swallowed by some exception handling code and the whole process then silently terminates. No exceptions are ever thrown to the browser and it is a bit tedious to debug (for understandable reasons). Is there any straightforward way to prevent this from happening? | ajax | prototype | javascript | exception | null | null | open | What is the most convenient way to stop an Ajax-object in prototype from swallowing exceptions?
===
Consider this code:
new Ajax.Request('?service=example', {
parameters : {tags : 'exceptions'},
onSuccess : this.dataReceived.bind(this)
});
If an exception occurs anywhere in the dataReceived-function when it is called by the Ajax-object, it is swallowed by some exception handling code and the whole process then silently terminates. No exceptions are ever thrown to the browser and it is a bit tedious to debug (for understandable reasons). Is there any straightforward way to prevent this from happening? | 0 |
10,390,628 | 04/30/2012 21:10:54 | 1,362,021 | 04/27/2012 21:19:57 | 1 | 0 | automatic plugin activation whenever we install that particular plugin | >
whenever we install a plugin then we have to activate it by clicking on activation link of the that plugin from admin section. Now what i want to do:-
I need a code so when install the plugin that plugin will activate by default so there is no need of clicking the activation link in admin section.
I want it for that particular plugin only not for the all the plugins in the theme. | wordpress-plugin | wordpress-plugin-dev | null | null | null | 05/01/2012 13:21:31 | not a real question | automatic plugin activation whenever we install that particular plugin
===
>
whenever we install a plugin then we have to activate it by clicking on activation link of the that plugin from admin section. Now what i want to do:-
I need a code so when install the plugin that plugin will activate by default so there is no need of clicking the activation link in admin section.
I want it for that particular plugin only not for the all the plugins in the theme. | 1 |
10,772,608 | 05/27/2012 08:17:40 | 901,379 | 08/18/2011 20:48:33 | 331 | 35 | Why does a large enterprise-level implementation of Ext.js crash every browser? | I are working on a implementation of EXT.js that I think is larger than its makers expected. Our pages instantiate over a 1000 EXT components.
This first issue is that, most of the time, a single page load is taking 20-30 seconds to return; during that time the browser displays a spinny wheel indicating that some resource is being used. Except that we are monitoring ram, hard drive, processor and network usage, and none of them are taxed. The server has completed it's request, so the delay is clearly being caused by EXT.
The second issue is that after a few clicks, Firefox displays a "slow script" error, Chrome displays a "Kill Page" error, and Safari simply crashes.
Again, RAM, Hard Drive, Network and Processor are all barely being used, yet the browser is unable to handle creating the EXT components.
Can anyone point me in the right direction towards load balancing EXT so that the browser is not so unhappy? | javascript | extjs | enterprise | frontend | cq5 | 05/27/2012 11:12:23 | not a real question | Why does a large enterprise-level implementation of Ext.js crash every browser?
===
I are working on a implementation of EXT.js that I think is larger than its makers expected. Our pages instantiate over a 1000 EXT components.
This first issue is that, most of the time, a single page load is taking 20-30 seconds to return; during that time the browser displays a spinny wheel indicating that some resource is being used. Except that we are monitoring ram, hard drive, processor and network usage, and none of them are taxed. The server has completed it's request, so the delay is clearly being caused by EXT.
The second issue is that after a few clicks, Firefox displays a "slow script" error, Chrome displays a "Kill Page" error, and Safari simply crashes.
Again, RAM, Hard Drive, Network and Processor are all barely being used, yet the browser is unable to handle creating the EXT components.
Can anyone point me in the right direction towards load balancing EXT so that the browser is not so unhappy? | 1 |
8,257,714 | 11/24/2011 13:19:11 | 1,063,999 | 11/24/2011 13:13:19 | 1 | 0 | How to convert an int to string in C | I know how to convert an str to int but, how i can do the inverse? Im trying to make a function that converts the data of an struct into an string to save it on a file.
Thanks. | c | string | integer | null | null | null | open | How to convert an int to string in C
===
I know how to convert an str to int but, how i can do the inverse? Im trying to make a function that converts the data of an struct into an string to save it on a file.
Thanks. | 0 |
11,608,559 | 07/23/2012 08:05:20 | 1,025,140 | 11/02/2011 07:16:13 | 36 | 0 | ifconfig command is not found | I am not able to find 'ifconfig' command, So I need to modify $PATH variable. Can you provide the best way to modify $PATH varible, whenever I logged-in.
[aaa@cyclrtp10 ~]$ ifconfig
ifconfig: Command not found.
[aaa@cyclrtp10 ~]$ echo $PATH
/usr/software/utils/bin:/usr/software/bin:/usr/software/rats/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
[aaa@cyclrtp10 ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:82:1E:2C
inet addr:10.60.250.73 Bcast:10.60.251.255 Mask:255.255.252.0
inet6 addr: fd20:8b1e:b255:800b:250:56ff:fe82:1e2c/64 Scope:Global
inet6 addr: fe80::250:56ff:fe82:1e2c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10597755438 errors:0 dropped:0 overruns:0 frame:0
TX packets:10754394830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7987750842424 (7.2 TiB) TX bytes:6618160592811 (6.0 TiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5156561681 errors:0 dropped:0 overruns:0 frame:0
TX packets:5156561681 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16690172948881 (15.1 TiB) TX bytes:16690172948881 (15.1 TiB)
[aaa@cyclrtp10 ~]$
| linux | bash | unix | .bash-profile | null | 07/23/2012 09:14:51 | off topic | ifconfig command is not found
===
I am not able to find 'ifconfig' command, So I need to modify $PATH variable. Can you provide the best way to modify $PATH varible, whenever I logged-in.
[aaa@cyclrtp10 ~]$ ifconfig
ifconfig: Command not found.
[aaa@cyclrtp10 ~]$ echo $PATH
/usr/software/utils/bin:/usr/software/bin:/usr/software/rats/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
[aaa@cyclrtp10 ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:82:1E:2C
inet addr:10.60.250.73 Bcast:10.60.251.255 Mask:255.255.252.0
inet6 addr: fd20:8b1e:b255:800b:250:56ff:fe82:1e2c/64 Scope:Global
inet6 addr: fe80::250:56ff:fe82:1e2c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10597755438 errors:0 dropped:0 overruns:0 frame:0
TX packets:10754394830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7987750842424 (7.2 TiB) TX bytes:6618160592811 (6.0 TiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5156561681 errors:0 dropped:0 overruns:0 frame:0
TX packets:5156561681 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16690172948881 (15.1 TiB) TX bytes:16690172948881 (15.1 TiB)
[aaa@cyclrtp10 ~]$
| 2 |
11,662,897 | 07/26/2012 05:26:26 | 1,553,142 | 07/26/2012 00:14:22 | 1 | 0 | ASM Extract/Unpack | I'm new at this, What does this mean?
.text:00405CB5 mov eax, dword_417910
.text:00405CBA mov ecx, dword_417900
.text:00405CC0 cmp eax, ecx
.text:00405CC2 jz loc_405D8D
.text:00405CC8 push eax
.text:00405CC9 lea edx, [esp+20]
.text:00405CCD push offset aKhanclient04d_ ; "KhanClient%04d.exe"
.text:00405CD2 push edx ; Dest
.text:00405CD3 call ds:sprintf
.text:00405CD9 lea eax, [esp+1Ch]
.text:00405CDD push eax ; lpszFileName
.text:00405CDE call sub_407760
.text:00405CE3 add esp, 10h
.text:00405CE6 test ax, ax
.text:00405CE9 jnz short loc_405CFA
.text:00405CEB pop edi
.text:00405CEC pop esi
.text:00405CED pop ebp
.text:00405CEE or ax, 0FFFFh
.text:00405CF2 pop ebx
.text:00405CF3 add esp, 98h
.text:00405CF9 retn
I believe what I have here is where the program reads a file, and extracts its contents.
Thank you very much. | assembly | null | null | null | null | 07/26/2012 10:14:25 | too localized | ASM Extract/Unpack
===
I'm new at this, What does this mean?
.text:00405CB5 mov eax, dword_417910
.text:00405CBA mov ecx, dword_417900
.text:00405CC0 cmp eax, ecx
.text:00405CC2 jz loc_405D8D
.text:00405CC8 push eax
.text:00405CC9 lea edx, [esp+20]
.text:00405CCD push offset aKhanclient04d_ ; "KhanClient%04d.exe"
.text:00405CD2 push edx ; Dest
.text:00405CD3 call ds:sprintf
.text:00405CD9 lea eax, [esp+1Ch]
.text:00405CDD push eax ; lpszFileName
.text:00405CDE call sub_407760
.text:00405CE3 add esp, 10h
.text:00405CE6 test ax, ax
.text:00405CE9 jnz short loc_405CFA
.text:00405CEB pop edi
.text:00405CEC pop esi
.text:00405CED pop ebp
.text:00405CEE or ax, 0FFFFh
.text:00405CF2 pop ebx
.text:00405CF3 add esp, 98h
.text:00405CF9 retn
I believe what I have here is where the program reads a file, and extracts its contents.
Thank you very much. | 3 |
10,493,348 | 05/08/2012 06:01:51 | 913,559 | 08/26/2011 07:12:24 | 157 | 10 | Garbage Collection not running for Code Cache Memory Pool | When I am printing the details of garbage collection using GarbageCollectorMXBean the output shows me the following information:-
Name: PS ScavengeCollection
count: 72
Collection time: 3041
Memory Pools: PS Eden Space PS Survivor Space
Name: PS MarkSweepCollection
count: 5
Collection time: 4922
Memory Pools: PS Eden Space PS Survivor Space PS Old Gen
Now quite rightly the ScavengeCollection and MarkSweep collection covers 4 of the 5 available memory pool excluding
> Code Cache (Non Heap Memory).
I want to know why the Garbage Collection never ran for
> Code Cache Memory Pool managed by CodeCacheManager Memory Pool.
Does it imply that GC never garbage collect objects from CodeCacheManager Memory Pool??
Is there any significance of the same?
| java | memory | garbage-collection | hotspot | null | null | open | Garbage Collection not running for Code Cache Memory Pool
===
When I am printing the details of garbage collection using GarbageCollectorMXBean the output shows me the following information:-
Name: PS ScavengeCollection
count: 72
Collection time: 3041
Memory Pools: PS Eden Space PS Survivor Space
Name: PS MarkSweepCollection
count: 5
Collection time: 4922
Memory Pools: PS Eden Space PS Survivor Space PS Old Gen
Now quite rightly the ScavengeCollection and MarkSweep collection covers 4 of the 5 available memory pool excluding
> Code Cache (Non Heap Memory).
I want to know why the Garbage Collection never ran for
> Code Cache Memory Pool managed by CodeCacheManager Memory Pool.
Does it imply that GC never garbage collect objects from CodeCacheManager Memory Pool??
Is there any significance of the same?
| 0 |
239,368 | 10/27/2008 09:00:34 | 20,514 | 09/22/2008 15:21:22 | 133 | 3 | What laptop is the most friendly to linux? (for programming) | I want to buy a laptop for programming under linux and I have no idea what specific problems can appear (like "no drivers for device", "impossible to hibernate" and so on...)
What should I think of when selecting new laptop for linux?
I will run Ubuntu, C++, SBCL. Also I will convert photos from my Nikon D80, but not more (so laptop is not graphics-oriented).
I've already owned Asus A9 and Samsung R40 laptops and neither of them were good enough.
These laptops were actually cheap, so I have no questions about them. But Macbook Pro is not an option for me either: it looks cool, but it's far too expensive. I think about IBM Thinkpad, but I'm not really sure if this is what I need.
So, my requirements are:
- long battery life;
- good drivers support for linux (Ubuntu);
- price not higher than $1500.
About other requirements I would better accept your opinion.
P.S. I've read <a href="http://stackoverflow.com/questions/9157/what-is-the-best-laptop-for-programmers">what-is-the-best-laptop-for-programmers</a>, but it doesn't answer my question... | laptop | linux | null | null | null | 01/25/2012 19:27:38 | not constructive | What laptop is the most friendly to linux? (for programming)
===
I want to buy a laptop for programming under linux and I have no idea what specific problems can appear (like "no drivers for device", "impossible to hibernate" and so on...)
What should I think of when selecting new laptop for linux?
I will run Ubuntu, C++, SBCL. Also I will convert photos from my Nikon D80, but not more (so laptop is not graphics-oriented).
I've already owned Asus A9 and Samsung R40 laptops and neither of them were good enough.
These laptops were actually cheap, so I have no questions about them. But Macbook Pro is not an option for me either: it looks cool, but it's far too expensive. I think about IBM Thinkpad, but I'm not really sure if this is what I need.
So, my requirements are:
- long battery life;
- good drivers support for linux (Ubuntu);
- price not higher than $1500.
About other requirements I would better accept your opinion.
P.S. I've read <a href="http://stackoverflow.com/questions/9157/what-is-the-best-laptop-for-programmers">what-is-the-best-laptop-for-programmers</a>, but it doesn't answer my question... | 4 |
5,606,134 | 04/09/2011 16:10:52 | 376,947 | 06/26/2010 12:43:39 | 284 | 5 | PHP: is_readable vs file_exists | Is there any difference between them? When should either of them be used?
- [file_exists][1]
- [is_readable][2]
[1]: http://php.net/manual/en/function.file-exists.php
[2]: http://php.net/manual/en/function.is-readable.php | php | file | file-exists | null | null | 04/09/2011 19:43:57 | not a real question | PHP: is_readable vs file_exists
===
Is there any difference between them? When should either of them be used?
- [file_exists][1]
- [is_readable][2]
[1]: http://php.net/manual/en/function.file-exists.php
[2]: http://php.net/manual/en/function.is-readable.php | 1 |
7,090,117 | 08/17/2011 08:52:22 | 622,875 | 02/18/2011 09:30:41 | 56 | 6 | Problem with Heroku addons developed as REST WCF in C#.Net | I have developed sample REST WCF application which contain simple get , put , post and delete call.
Now i would like to put this addon on heroku so i need to build provisioning API as per steps mentioned on heroku.com's guidelines https://addons.heroku.com/provider/resources/technical/build/provisioning , but i failed with step 5 could not go beyond that since last week so if any one can help me out then it will great for me.
I have also make changes in response of get call to Json format also as per suggested by supporter of heroku platform as like
http://localhost/RestWCFDemo/RestServiceImpl.svc/get/heroku/resources/1
Response : "{"UserId":1,"UserName":"Arun"}"
and when i execute command : kensa test sso 1 ,then it will give me following error
!expected 403 , got 200..
Thanks
Arun. | heroku | null | null | null | null | null | open | Problem with Heroku addons developed as REST WCF in C#.Net
===
I have developed sample REST WCF application which contain simple get , put , post and delete call.
Now i would like to put this addon on heroku so i need to build provisioning API as per steps mentioned on heroku.com's guidelines https://addons.heroku.com/provider/resources/technical/build/provisioning , but i failed with step 5 could not go beyond that since last week so if any one can help me out then it will great for me.
I have also make changes in response of get call to Json format also as per suggested by supporter of heroku platform as like
http://localhost/RestWCFDemo/RestServiceImpl.svc/get/heroku/resources/1
Response : "{"UserId":1,"UserName":"Arun"}"
and when i execute command : kensa test sso 1 ,then it will give me following error
!expected 403 , got 200..
Thanks
Arun. | 0 |
8,637,194 | 12/26/2011 15:53:25 | 410,422 | 08/04/2010 06:30:03 | 66 | 1 | Separating EOF from the character buffer of a Getline | I am using getline to fetch characters in buffers from an input file, once I have a buffer in place , i read through all the characters and do a lookup on a map (for some further operations).
The problem is that once valid characters are over, my program fetches the eof from the input stream and tries to look for it in the map. This, as expected causes a lot of bad things to happen.
I tried to use inputStream.eof() or eofbit , but the problem is that both of these get set as soon as the final buffer (which may have up to 254 valid characters and one EOF) , now I need the program to wait until all valid (non EOF) characters have been processed and as soon as it gets to eof follow a separate execution path.
Algorithmic explanation :
->initialize input stream
->read in character buffer of 256 chars
->Loop through all characters in this buffer
->If current character is not eof (problem arises here , if this is the final buffer then both eof() and eofbit checks say that the file has ended, but the buffer still has stuff that is yet to be processed)
->do some stuff
->If current character is not eof
->do some other stuff | c++ | file-io | eof | null | null | null | open | Separating EOF from the character buffer of a Getline
===
I am using getline to fetch characters in buffers from an input file, once I have a buffer in place , i read through all the characters and do a lookup on a map (for some further operations).
The problem is that once valid characters are over, my program fetches the eof from the input stream and tries to look for it in the map. This, as expected causes a lot of bad things to happen.
I tried to use inputStream.eof() or eofbit , but the problem is that both of these get set as soon as the final buffer (which may have up to 254 valid characters and one EOF) , now I need the program to wait until all valid (non EOF) characters have been processed and as soon as it gets to eof follow a separate execution path.
Algorithmic explanation :
->initialize input stream
->read in character buffer of 256 chars
->Loop through all characters in this buffer
->If current character is not eof (problem arises here , if this is the final buffer then both eof() and eofbit checks say that the file has ended, but the buffer still has stuff that is yet to be processed)
->do some stuff
->If current character is not eof
->do some other stuff | 0 |
5,263,717 | 03/10/2011 17:56:01 | 653,994 | 03/10/2011 17:20:14 | 1 | 0 | Display Photos android code | How do u access the photos from internal storage on your phone
and display it | java | android | null | null | null | 03/11/2011 02:04:17 | not a real question | Display Photos android code
===
How do u access the photos from internal storage on your phone
and display it | 1 |
11,545,148 | 07/18/2012 15:40:54 | 588,855 | 08/06/2010 17:52:56 | 1,639 | 12 | C++ - selecting a set of features | I'm trying to insert a list of features in a `vector`, and, after that, based on a criterion function's (i.e; formula) result add a feature. The code so far is shown below.
The main parts here I want to ask about are:
**Do you think it would be a good idea to insert the features in the way made here? That is, as a vector of struct? Or, just add the features immediately? The reason I made a vector of struct is that I want to add integer values to the vector, but, at the same time, to have names for features (i.e; F1, F2, ...etc).**
**For the `criterionFunction()` shown below, I'm trying it to consider for example `features[1]` to have the value `1` if it is selected (i.e; passed to the function) and `0` otherwise. It seems here like something `boolean` is going on? :-) What do you recommend doing here?**
#include "stdafx.h"
#include <iostream>
#include <vector>
int main(){
std::struct Features{
int F1;
int F2;
int F3;
int F4;
};
std::vector<Features> listOfFeatures(4);
for(std::vector<Features>::iterator i = listOfFeatures.begin(); i != listOfFeatures.end(); i++){
std::int maxValue = criterionFunction(*listOfFeatures);
}
}
std::int criterionFunction(std::int *features){
return -2*features[1]*features[2]+3*features[1]+5*features[2]-2*features[1]*features[2]*
features[3]+7*features[3]+4*features[4]-2*features[1]*features[2]*features[3]*
features[4];
}
Thanks. | c++ | vector | struct | boolean | null | 07/19/2012 15:19:06 | not a real question | C++ - selecting a set of features
===
I'm trying to insert a list of features in a `vector`, and, after that, based on a criterion function's (i.e; formula) result add a feature. The code so far is shown below.
The main parts here I want to ask about are:
**Do you think it would be a good idea to insert the features in the way made here? That is, as a vector of struct? Or, just add the features immediately? The reason I made a vector of struct is that I want to add integer values to the vector, but, at the same time, to have names for features (i.e; F1, F2, ...etc).**
**For the `criterionFunction()` shown below, I'm trying it to consider for example `features[1]` to have the value `1` if it is selected (i.e; passed to the function) and `0` otherwise. It seems here like something `boolean` is going on? :-) What do you recommend doing here?**
#include "stdafx.h"
#include <iostream>
#include <vector>
int main(){
std::struct Features{
int F1;
int F2;
int F3;
int F4;
};
std::vector<Features> listOfFeatures(4);
for(std::vector<Features>::iterator i = listOfFeatures.begin(); i != listOfFeatures.end(); i++){
std::int maxValue = criterionFunction(*listOfFeatures);
}
}
std::int criterionFunction(std::int *features){
return -2*features[1]*features[2]+3*features[1]+5*features[2]-2*features[1]*features[2]*
features[3]+7*features[3]+4*features[4]-2*features[1]*features[2]*features[3]*
features[4];
}
Thanks. | 1 |
2,880,198 | 05/21/2010 07:15:09 | 305,866 | 03/31/2010 09:25:19 | 54 | 1 | Is it possible to set image or button at the center of navigationbar in iphone? | Is it possible to set image or button at the center of navigationbar in iphone? | iphone | objective-c | uinavigationcontroller | null | null | null | open | Is it possible to set image or button at the center of navigationbar in iphone?
===
Is it possible to set image or button at the center of navigationbar in iphone? | 0 |
5,813,180 | 04/28/2011 03:12:52 | 728,470 | 04/28/2011 03:12:52 | 1 | 0 | How to decide the size of image while designing a UI for android application | How to determine the size of the image while designing Ui for android application.
I want my application support in different devices with various Screen size and resolution.Designing work of the application is doing seperatily by designers
Now I have to Questions
2. How can I give the input to the designers for designing application UI.
2. I set background of the UI as image of character but it seems Stretched showing in a weird way
Any links about the designing greatly appreciate
Regards
Feather
| android | design | user-interface | null | null | null | open | How to decide the size of image while designing a UI for android application
===
How to determine the size of the image while designing Ui for android application.
I want my application support in different devices with various Screen size and resolution.Designing work of the application is doing seperatily by designers
Now I have to Questions
2. How can I give the input to the designers for designing application UI.
2. I set background of the UI as image of character but it seems Stretched showing in a weird way
Any links about the designing greatly appreciate
Regards
Feather
| 0 |
11,664,432 | 07/26/2012 07:28:59 | 1,071,091 | 11/29/2011 10:40:28 | 214 | 15 | CDN Support for bundling | Is there CDN Support for bundling in asp.net MVC4 ?
For example I don't want to host my own version of jquery locally and i would like to use Google CDN.
| javascript | asp.net-mvc | cdn | null | null | null | open | CDN Support for bundling
===
Is there CDN Support for bundling in asp.net MVC4 ?
For example I don't want to host my own version of jquery locally and i would like to use Google CDN.
| 0 |
11,190,212 | 06/25/2012 13:22:35 | 7,059 | 09/15/2008 13:05:45 | 1,361 | 55 | How to extract branches extending trunk from a SVN repository to a new repository with history | I've googled that problem quite a bit , but didn't find what I need.
I've a repository that looks like this
/Project_A
+- trunk
+- branches
+- Version_1
+- Version_2
+- 1st_Custom_version_for_customer_A
+- 2nd_Custom_version_for_customer_A
/Project_B
+- trunk
+- branches
+- Version_1
+- Version_2
+- 1st_Custom_version_for_customer_A
+- 2nd_Custom_version_for_customer_A
The branches are offsprings of their trunks counterparts. For example for Project_A
Trunk ------------------------------------------------------>
Version_1 \---------> \
Version_2 \---------> \
1st_Custom_version_for_customer_A \--------------->
The custom versions have a life of their own now and don't get any updates from the trunk anymore (many differences).
I need to extract only the revisions that are relevant to the customer in a new repository. That is : /Project_A/trunk till the moment where the 1st_Custom_version_for_customer_A was created. Then /Project_A/branches/1st_Custom_version_for_customer_A and /Project_A/branches/2nd_Custom_version_for_customer_A. And then the same for Project B. All in the same repository.
I've tried svnsync but could only extract /Project_A/branches/2nd_Custom_version_for_customer_A, and even though the history is good, I still see all the commit messages for other branches (which is a problem in my case).
As for svndumpfilter, if would be perfect if I had everything under "/Customer_A" from the beginning (I will work this way next time), but when the branch is a copy from another branch, then gets sometimes renamed, deleted, recrated, etc... I don't see it working properly.
Is there a tool or something that could help me get the work done here ?
Thanks | svn | branch | svnsync | svndumpfilter | svndump | null | open | How to extract branches extending trunk from a SVN repository to a new repository with history
===
I've googled that problem quite a bit , but didn't find what I need.
I've a repository that looks like this
/Project_A
+- trunk
+- branches
+- Version_1
+- Version_2
+- 1st_Custom_version_for_customer_A
+- 2nd_Custom_version_for_customer_A
/Project_B
+- trunk
+- branches
+- Version_1
+- Version_2
+- 1st_Custom_version_for_customer_A
+- 2nd_Custom_version_for_customer_A
The branches are offsprings of their trunks counterparts. For example for Project_A
Trunk ------------------------------------------------------>
Version_1 \---------> \
Version_2 \---------> \
1st_Custom_version_for_customer_A \--------------->
The custom versions have a life of their own now and don't get any updates from the trunk anymore (many differences).
I need to extract only the revisions that are relevant to the customer in a new repository. That is : /Project_A/trunk till the moment where the 1st_Custom_version_for_customer_A was created. Then /Project_A/branches/1st_Custom_version_for_customer_A and /Project_A/branches/2nd_Custom_version_for_customer_A. And then the same for Project B. All in the same repository.
I've tried svnsync but could only extract /Project_A/branches/2nd_Custom_version_for_customer_A, and even though the history is good, I still see all the commit messages for other branches (which is a problem in my case).
As for svndumpfilter, if would be perfect if I had everything under "/Customer_A" from the beginning (I will work this way next time), but when the branch is a copy from another branch, then gets sometimes renamed, deleted, recrated, etc... I don't see it working properly.
Is there a tool or something that could help me get the work done here ?
Thanks | 0 |
4,698,907 | 01/15/2011 09:46:00 | 538,705 | 12/11/2010 06:44:15 | 10 | 0 | How to copy the source of a page and make it work | This was helpful: http://www.design215.com/toolbox/whitespace.php
but i wanted to host in here in my computer locally, but it doesn't work when i view source code and copy the whole thing?
i'm a javascript noob, i just wanted to put in a page the box below `DO NOT use this for Javascript. Use our Javascript Compressor.` until the top of `notes`
Hope someone could help me do that :)
| javascript | null | null | null | null | null | open | How to copy the source of a page and make it work
===
This was helpful: http://www.design215.com/toolbox/whitespace.php
but i wanted to host in here in my computer locally, but it doesn't work when i view source code and copy the whole thing?
i'm a javascript noob, i just wanted to put in a page the box below `DO NOT use this for Javascript. Use our Javascript Compressor.` until the top of `notes`
Hope someone could help me do that :)
| 0 |
2,665,553 | 04/19/2010 06:35:10 | 210,281 | 11/13/2009 08:41:18 | 23 | 1 | Php Form data to Google Spreadsheets | I am trying to save data from my existing webform written in php to a google spreadsheet. I tried the Zend GData and can't seem to find my way around it. Does anyone have a better solution for this.
Is it possible to grab the data and insert it into mysql database and to google spreadsheet at the same time? | google-spreadsheet | google-docs | zend-gdata | null | null | null | open | Php Form data to Google Spreadsheets
===
I am trying to save data from my existing webform written in php to a google spreadsheet. I tried the Zend GData and can't seem to find my way around it. Does anyone have a better solution for this.
Is it possible to grab the data and insert it into mysql database and to google spreadsheet at the same time? | 0 |
11,667,517 | 07/26/2012 10:39:08 | 1,554,339 | 07/26/2012 10:36:33 | 1 | 0 | Which is the best SSL Certificate? | How does an SSL works? what is the need of an ssl certificate? Which is the best SSL Certificate to choose for my new website? | ssl | ssl-certificate | null | null | null | 07/27/2012 14:48:49 | not a real question | Which is the best SSL Certificate?
===
How does an SSL works? what is the need of an ssl certificate? Which is the best SSL Certificate to choose for my new website? | 1 |
8,910,759 | 01/18/2012 13:17:25 | 187,206 | 10/09/2009 13:57:31 | 2,359 | 60 | Why Can't I SuppressWarnings on a Package? | I see from the javadoc that the [@SuppressWarnings][1] annotation applies to
TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE
targets. Why does it not also apply to `PACKAGE`?
I have some generated code which contains some raw types warnings. I'd like to be able to add a `package-info.java` file for the generated classes (in a separate physical directory but the same java package) which tells eclipse to ignore any raw types warnings emanating from the generated classes in package.
Why is this not supported? Is there an alternate way of suppressing a warning in an entire package?
[1]: http://docs.oracle.com/javase/7/docs/api/java/lang/SuppressWarnings.html
| java | annotations | null | null | null | null | open | Why Can't I SuppressWarnings on a Package?
===
I see from the javadoc that the [@SuppressWarnings][1] annotation applies to
TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE
targets. Why does it not also apply to `PACKAGE`?
I have some generated code which contains some raw types warnings. I'd like to be able to add a `package-info.java` file for the generated classes (in a separate physical directory but the same java package) which tells eclipse to ignore any raw types warnings emanating from the generated classes in package.
Why is this not supported? Is there an alternate way of suppressing a warning in an entire package?
[1]: http://docs.oracle.com/javase/7/docs/api/java/lang/SuppressWarnings.html
| 0 |
8,520,052 | 12/15/2011 12:21:14 | 565,200 | 01/06/2011 08:51:52 | 337 | 27 | Subarray from NSMutableArray | I have a NSMutableArray with many objects.
Can i extract a subarray from index range 'i' to 'j' directly?
Yeah i know i can do a loop and use objectAtIndex:x and extract each object to a new.
I need to call a method which input is an array and want to use this array only with validate data. | objective-c | nsmutablearray | sub-array | null | null | null | open | Subarray from NSMutableArray
===
I have a NSMutableArray with many objects.
Can i extract a subarray from index range 'i' to 'j' directly?
Yeah i know i can do a loop and use objectAtIndex:x and extract each object to a new.
I need to call a method which input is an array and want to use this array only with validate data. | 0 |
9,916,266 | 03/28/2012 21:58:55 | 1,251,004 | 03/05/2012 23:13:56 | 66 | 0 | My first vps! Where to start? | I just got my first vps which i will use for an online game. However, I have only worked with normal webhost so far (with control panel, mysql, php, phpmyadmin already installed), and I have no idea what to do now. The only thing I have is the ip adress, username and password to the vps.
I would like to have some kind of control panel to login to see some stats, phpmyadmin to control the mysql database, and the ability to upload and store the .php files thats talks with the mysql db. I read a little about LAMP (apache), is that good?
Where do I start?
Many thanks
VPS os is debian 6.
Im using a mac | php | mysql | vps | null | null | 03/29/2012 06:02:51 | off topic | My first vps! Where to start?
===
I just got my first vps which i will use for an online game. However, I have only worked with normal webhost so far (with control panel, mysql, php, phpmyadmin already installed), and I have no idea what to do now. The only thing I have is the ip adress, username and password to the vps.
I would like to have some kind of control panel to login to see some stats, phpmyadmin to control the mysql database, and the ability to upload and store the .php files thats talks with the mysql db. I read a little about LAMP (apache), is that good?
Where do I start?
Many thanks
VPS os is debian 6.
Im using a mac | 2 |
3,960,548 | 10/18/2010 15:12:35 | 461,609 | 09/29/2010 10:30:01 | 234 | 23 | C++ weird syntax, what is it with the second new? | Can some one explain what exactly the second line does? i've seen this when answering to someone's question.
int * x = new int [1] ;
int * y = new (x) int;
After the second line x and y have the same value(pointer to a same place). What's the difference between y=x and the second line? Is it like constructor or something? | c++ | constructor | new-operator | null | null | null | open | C++ weird syntax, what is it with the second new?
===
Can some one explain what exactly the second line does? i've seen this when answering to someone's question.
int * x = new int [1] ;
int * y = new (x) int;
After the second line x and y have the same value(pointer to a same place). What's the difference between y=x and the second line? Is it like constructor or something? | 0 |
11,526,622 | 07/17/2012 16:14:18 | 385,559 | 07/07/2010 13:18:18 | 1,810 | 67 | In app purchases: Urban Airship v. native StoreKit, et. al | I need to develop an iPhone app which will have sound files available for in app purchases. Is using Urban Airship really advantageous compared to just trying to go it alone with the StoreKit framework? Especially considering that iOS 6 is supposed to make this process easier and UA takes quite a high percentage of the revenue, I am questioning using them.
In other words, is it possible to get a complete *pros and cons* concerning using Urban Airship? Those with experience, your feedback would be much appreciated. | iphone | ios | ipad | app-store | urbanairship.com | 07/20/2012 12:32:01 | not constructive | In app purchases: Urban Airship v. native StoreKit, et. al
===
I need to develop an iPhone app which will have sound files available for in app purchases. Is using Urban Airship really advantageous compared to just trying to go it alone with the StoreKit framework? Especially considering that iOS 6 is supposed to make this process easier and UA takes quite a high percentage of the revenue, I am questioning using them.
In other words, is it possible to get a complete *pros and cons* concerning using Urban Airship? Those with experience, your feedback would be much appreciated. | 4 |
9,759,060 | 03/18/2012 14:20:12 | 905,418 | 05/30/2011 23:35:47 | 806 | 27 | Flex Project vs Flash Professional Project | I've just got my Flash Builder 4 and now I want to create a project. The Flash Builder 4 IDE shows me 2 options: (1) Flex Project, (2) Flash Professional Project.
I know that "Flex Builder" was the former name of "Flash Builder", however, I don't know which of the 2 project types mentioned above is more advanced. | flash | flex | air | project | builder | null | open | Flex Project vs Flash Professional Project
===
I've just got my Flash Builder 4 and now I want to create a project. The Flash Builder 4 IDE shows me 2 options: (1) Flex Project, (2) Flash Professional Project.
I know that "Flex Builder" was the former name of "Flash Builder", however, I don't know which of the 2 project types mentioned above is more advanced. | 0 |
4,723,435 | 01/18/2011 11:19:38 | 443,626 | 09/09/2010 16:19:06 | 16 | 0 | Pricing for adding specific AJAX Controls to your website? | I am going to start and develop a e-commerce website for someone, i just wanted to now if i were to create som AJAX Controls for the site how much should i charge?
The kind of AJAX Control would be where a user clicks on a product and pops open a div element in the center of the screen with the product item and information and an add to backet button. The add to basket button will use an AJAX call and will perform the steps to add the item to the basket.
There will be other AJAX Controls i want to talk to him about but if i can have a general idea of how much this type of control would cost, then i can decide on how much other AJAX Controls can be priced.
i would love some feedback, and would be greatfull.
Thanks. | .net | asp.net | ajax | custom-server-controls | null | 01/18/2011 12:46:42 | off topic | Pricing for adding specific AJAX Controls to your website?
===
I am going to start and develop a e-commerce website for someone, i just wanted to now if i were to create som AJAX Controls for the site how much should i charge?
The kind of AJAX Control would be where a user clicks on a product and pops open a div element in the center of the screen with the product item and information and an add to backet button. The add to basket button will use an AJAX call and will perform the steps to add the item to the basket.
There will be other AJAX Controls i want to talk to him about but if i can have a general idea of how much this type of control would cost, then i can decide on how much other AJAX Controls can be priced.
i would love some feedback, and would be greatfull.
Thanks. | 2 |
10,917,917 | 06/06/2012 16:05:06 | 1,438,225 | 06/05/2012 19:44:22 | 1 | 0 | Translate C To Mips | i need to understand if i do it correct.
this is what i have so far
this is the code in C
int i;
void set_array(int num){
int A[10];
for (i = 0; i < 10; i++){
A[i] = compare(num,i);}}
int compare(int a, int b){
if ((a-b) >= 0)
return 1;
else return 0;}}}
this is what i've done so far:
MAIN:
addi $sp, $sp,-4 #adust stack for 1 more item
sw $s0, 0($sp) #save $s0
set_array:
move $s0, $zero # i = 0
Loop:
add $s0,$s0,4 #i++
add $t1, $a0, $s0 #t2 contain A[i] address
add $t1, compare(
slti $t6, $s0, 40 # reg $t6 = 0 if $s0 < 40 (meaning: i<10)
jal compare
bne $t6, $zero, loop # go to loop if $t6 = 0
jr $ra # Return
Compare:
blt $a2,$a3,Else #if $s4 < $t5, branch to Else
li $v0,1
else:
li $v0,0
============
and to be straight with this - i have little knowlage and have no idea if i was way off or not...
thanks for all helpers. god bless you
| c | mips | null | null | null | 06/07/2012 10:16:49 | too localized | Translate C To Mips
===
i need to understand if i do it correct.
this is what i have so far
this is the code in C
int i;
void set_array(int num){
int A[10];
for (i = 0; i < 10; i++){
A[i] = compare(num,i);}}
int compare(int a, int b){
if ((a-b) >= 0)
return 1;
else return 0;}}}
this is what i've done so far:
MAIN:
addi $sp, $sp,-4 #adust stack for 1 more item
sw $s0, 0($sp) #save $s0
set_array:
move $s0, $zero # i = 0
Loop:
add $s0,$s0,4 #i++
add $t1, $a0, $s0 #t2 contain A[i] address
add $t1, compare(
slti $t6, $s0, 40 # reg $t6 = 0 if $s0 < 40 (meaning: i<10)
jal compare
bne $t6, $zero, loop # go to loop if $t6 = 0
jr $ra # Return
Compare:
blt $a2,$a3,Else #if $s4 < $t5, branch to Else
li $v0,1
else:
li $v0,0
============
and to be straight with this - i have little knowlage and have no idea if i was way off or not...
thanks for all helpers. god bless you
| 3 |
11,518,875 | 07/17/2012 08:39:21 | 1,518,154 | 07/11/2012 14:48:21 | 1 | 0 | Javascript to objective c | I'm trying to convert the vodt calculator in this website http://www.runbayou.com/jackd.htm to a objective c project. I have done a UI of just an text field and a picker view for the distance but I'm lost on how to rewrite the javascript in objective c.
PS. I can't just use a web view and import a html file. | javascript | html | objective-c | uitextfield | uipickerview | 07/18/2012 00:02:43 | not a real question | Javascript to objective c
===
I'm trying to convert the vodt calculator in this website http://www.runbayou.com/jackd.htm to a objective c project. I have done a UI of just an text field and a picker view for the distance but I'm lost on how to rewrite the javascript in objective c.
PS. I can't just use a web view and import a html file. | 1 |
11,043,953 | 06/15/2012 02:36:56 | 1,432,136 | 06/02/2012 08:02:39 | 6 | 0 | how to let visitors send me emails through my website? | I need my website visitors to send me feedbacks about my website where he/she could quickly write things on the form then, when he/she summits, the feedback directly sends to my personal email.
i've been learning about coding for couple months and
would this require professional level of skills?
please give me advice on what i should do first in order to make this kind of thing on my personal website.
thank you in advance!
| php | javascript | email | website | message | 06/15/2012 02:43:35 | not a real question | how to let visitors send me emails through my website?
===
I need my website visitors to send me feedbacks about my website where he/she could quickly write things on the form then, when he/she summits, the feedback directly sends to my personal email.
i've been learning about coding for couple months and
would this require professional level of skills?
please give me advice on what i should do first in order to make this kind of thing on my personal website.
thank you in advance!
| 1 |
10,746,234 | 05/24/2012 22:34:21 | 398,248 | 07/21/2010 16:44:32 | 1,606 | 26 | How to minimize OpenCv library size? | I'm looking to minimize the size of my android ndk built library.
I have started with the pre-built OpenCv libraries for Android and as of now the size of my lib is about 3MB. How can I minimize it's size?
I only need read/write files capability, png encode/decode, jpeg decoder and the typical image manipulation functions from OpenCv such as resize and cvtColor.
Any pointers greatly appreciated! | opencv | android-ndk | null | null | null | null | open | How to minimize OpenCv library size?
===
I'm looking to minimize the size of my android ndk built library.
I have started with the pre-built OpenCv libraries for Android and as of now the size of my lib is about 3MB. How can I minimize it's size?
I only need read/write files capability, png encode/decode, jpeg decoder and the typical image manipulation functions from OpenCv such as resize and cvtColor.
Any pointers greatly appreciated! | 0 |
11,258,839 | 06/29/2012 08:56:32 | 1,099,116 | 12/15/2011 04:07:40 | 1 | 0 | Turn algorithm into one line function only using arithmetic operator | I want to turn this function :
$n=11;
$k=2;
$l=$n;
$total=array();
do{
$x=floor($n/$k);
$y=$k*$x;
$n=$n-$y+$x;
array_push($total, $x);
}while($n>=$k);
$result = $l + array_sum($total);
print_r($result);
into a function without looping or conditional statement, and only using arithmetic operator (+,-,*,/) with assumption division result will be rounded down.
Regards. | php | c | algorithm | linear-algebra | null | 06/29/2012 09:59:30 | not a real question | Turn algorithm into one line function only using arithmetic operator
===
I want to turn this function :
$n=11;
$k=2;
$l=$n;
$total=array();
do{
$x=floor($n/$k);
$y=$k*$x;
$n=$n-$y+$x;
array_push($total, $x);
}while($n>=$k);
$result = $l + array_sum($total);
print_r($result);
into a function without looping or conditional statement, and only using arithmetic operator (+,-,*,/) with assumption division result will be rounded down.
Regards. | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.