Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,684,485 | 1 | 5,711,865 | null | 0 | 475 |
I have a pop-up built using Jquery.Block-UI and ajax.. and i have no issues with the functionality but the thing is CSS, when i checked in Chrome there are no CSS problem... But when it comes to IE and FIREFOX its worse.. the Design of pop-up is gone... please take a look at images below
```
IN CHROME : WORKS FINE:
```

```
IN IE-8
```

```
IN FIREFOX:
```

Here is the Code:
In head tag:
```
<link href="style.css" rel="stylesheet" type="text/css" />
```
Content:
```
<table class="quot-popup" cellpadding="0" cellspacing="0">
<tr><td><div style="float: right;"><input type="image" style="" src="../Webimages/x.png" onclick="closePop();"/></div></td></tr>
<%if(navLevel.trim().equalsIgnoreCase("0")){%>
<tr><td class="poptd">Are you a Registered User please <a href="web/login.jsp">Sign in</a> to Quote List, Or <a href="web/new_user_registration.jsp">Sign Up</a> to Register.</td></tr>
<%}else if(navLevel.trim().equalsIgnoreCase("1")){%>
<tr><td class="poptd">Are you a Registered User please <a href="login.jsp">Sign in</a> to Quote List, Or <a href="new_user_registration.jsp">Sign Up</a> to Register.</td></tr>
<%}%>
<tr><td class="poptd">Or</td></tr>
<tr><td class="poptd">You want to continue without Register, <a href="javascript:showMail();">Click Here</a> to Quote List.</td></tr>
</table>
<table id="askEmail" class="quot-mailPopup" cellpadding="0" cellspacing="0">
<tr><td class="mailtd1">Enter your Email Address : </td>
<td class="mailtd2"><input type="text" id="anonymousEmailId" name="anonymousEmailId" value=""/></td>
<td class="mailtd3"><input type="image" src="../Webimages/go-btn.jpg" onclick="sbtEmail(); return false;"/></td></tr>
</table>
```
CSS:
```
table.quot-popup{width: 100%; font-size: 11px; font-weight: bold;}
table.quot-popup td.poptd{padding-top:6px;padding-bottom:6px; text-align: center; vertical-align:middle; color:#0ea05f;}
table.quot-popup td.poptd A:hover{color:#99CF99;}
table.quot-popup{width: 100%; font-size: 11px; font-weight: bold;}
table.quot-popup td.poptd{padding-top:6px;padding-bottom:6px; text-align: center; vertical-align:middle; color:#0ea05f;}
table.quot-popup td.poptd A:hover{color:#99CF99;}
table.quot-mailPopup{width: 100%; font-size: 11px; font-weight: bold; display: none; text-align: center;}
table.quot-mailPopup td.mailtd1{width: 40%; padding-top:6px;padding-bottom:6px; text-align: center; vertical-align:middle; color:#0ea05f;}
table.quot-mailPopup td.mailtd2{width: 50%; padding-top:6px;padding-bottom:6px; padding-right:3px; text-align: center; vertical-align:middle; color:#0ea05f;}
table.quot-mailPopup td.mailtd2 input{width: 250px; height:18px;}
table.quot-mailPopup td.mailtd3{padding-top:6px;padding-bottom:6px; text-align: center; vertical-align:middle; color:#0ea05f;}
```
Html: `pop up will be called on click <a href="***.jsp" id="QutLstLnkId">List</a>`
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<link href="Webcss/style.css" rel="stylesheet" type="text/css" />
<link href="Webcss/contentslider.css" rel="stylesheet" type="text/css" />
<link href="Webcss/jquery.jcarousel.css" rel="stylesheet" type="text/css" />
<link href="Webimages/favicon.ico" rel="shortcut icon" />
<script type="text/javascript" src="Webjs/jquery.js"></script>
<script type="text/javascript" src="Webjs/jquery.blockUI.js"></script>
<script type="text/javascript" src="Webjs/ajax.js"></script>
<script type="text/javascript">
//------------------------------------- For Pop-Up
$(function() {
$('#QutLstLnkId').click(function() {
var qMailId = $("#qtMailId").val();
qMailId = $.trim(qMailId);
if(qMailId == "null" || qMailId == ""){
$.blockUI({
message: $('#messageDispDiv'),css: {
width:'530px',
height:'auto',
top: ($(window).height() - 110) /2 + 'px',
left: ($(window).width() - 530) /2 + 'px'
} });
$("#messageDispDiv").block({css:{border: 'none',padding: '15px',backgroundColor: '#000','-webkit-border-radius': '10px','-moz-border-radius': '10px',width:'200px',opacity: .5,color: '#0A7A48'}});
enqueue("web/quoteList.jsp?oper=QUOTLSTAUTH&pg=0",processAjax);
}else{window.location.href="web/createQuoteList.jsp";}
});
});
function processAjax(s){
$("#messageDispDiv").unblock();
$("#messageDispDiv").html(s);
}
function closePop(){
$.unblockUI();
}
function showMail(){
$("#askEmail").show();
}
//------------------------------------- For Pop-Up
</script>
</head>
<body>
<!-- PopUp div -->
<div id="messageDispDiv" style=" display: none; width:530px; min-height: 110px; border: 1px solid #0A7A48; text-align:center;">
<div id="askEmailId" style="display:none;">
</div>
</div>
<!-- PopUp div -->
</body>
</html>
```
Thank you.
|
CSS problem in IE and FireFox
|
CC BY-SA 3.0
| null |
2011-04-16T04:32:08.147
|
2011-04-19T05:07:25.103
|
2011-04-16T04:47:27.627
| 659,952 | 659,952 |
[
"css",
"ajax",
"jquery-ui"
] |
5,684,574 | 1 | null | null | 20 | 6,748 |
I am trying to make sense of the statement in book effective c++. Following is the inheritance diagram for multiple inheritance.


Now the book says separate memory in each class is required for vptr. Also it makes following statement
I could not see any reason why there is requirement of separate memory in each class for vptr. I had an understanding that vptr is inherited from base class whatever may be the inheritance type. If we assume that it shown resultant memory structure with inherited vptr how can they make the statement that
> B and D can share a vptr
Can somebody please clarify a bit about vptr in multiple inheritance?
- -
|
understanding vptr in multiple inheritance?
|
CC BY-SA 4.0
| 0 |
2011-04-16T04:58:16.740
|
2018-07-09T04:01:08.980
|
2020-06-20T09:12:55.060
| -1 | 138,604 |
[
"c++",
"multiple-inheritance",
"vtable",
"virtual-inheritance",
"vptr"
] |
5,684,646 | 1 | 5,684,757 | null | 0 | 2,819 |
I have 6 view controllers on a UITabBarController. Each of them has a UINavigationBar at the top of them (Not linked to a UINavigationController), for showing the title of that view controller, and some buttons for controlling it. This was fine while I had 5 controllers, as no 'More' button would appear, but when I add a 6th, the more button appears. The tabs under that end up having two UINavigationBars! One is the one I added, with my title, the other is created by the TabBar and has a 'Back' arrow to go back to the more page. How can I fix this, either by merging them or otherwise?
Thanks, if you want screenshots just ask.
Here's a screenshot

The brown one is a UINavigationBar subclass I made, and added to the view in IB. The other one was added by the Tab Bar controller.
|
Tabs under UITabBarController's More button have 2 navigation bars
|
CC BY-SA 3.0
| 0 |
2011-04-16T05:16:38.610
|
2012-03-14T12:14:34.253
|
2011-12-07T23:44:20.577
| 84,042 | 350,202 |
[
"iphone",
"ios",
"uitabbarcontroller",
"uinavigationbar"
] |
5,684,677 | 1 | 5,684,708 | null | 3 | 1,623 |
I have 1 application , in which conditions are like i have to use local databases only for each PC....Now if some enrollment is done from 1 pc then that data should be store in local database and also it should be send to another PC...in short i want to synchronise all the data..
I need to clear 1 thing that "Centralize database is not possible..I cant use 1 database and connect to it from all PC.."So i need synchronization only...
I am using SQL SERVER Express Edition...
and developing application in C# .NET
If have any doubt you can ask me i will describe more...

|
Sql server database synchronisation
|
CC BY-SA 3.0
| 0 |
2011-04-16T05:26:48.907
|
2011-04-16T05:56:07.960
| null | null | 531,014 |
[
"c#",
"sql",
"sql-server-2008",
"synchronization",
"data-synchronization"
] |
5,684,737 | 1 | 5,684,867 | null | 5 | 5,204 |
First, I create a simple dll called `SimpleDll.dll`, its head file:
```
// SimpleDll.h
#ifdef MYLIBAPI
#else
#define MYLIBAPI __declspec(dllimport)
#endif
MYLIBAPI int Add(int a. int b);
```
its source code:
```
// SimpleDll.c
#include <windows.h>
#define MYLIBAPI __declspec(dllexport)
#include "SimpleDll.h"
int Add(int a, int b)
{
return a + b;
}
```
Then I call it in another project, and it works fine:
```
// TestSimpleDll.c
#include "stdafx.h"
#include <windows.h>
#include "SimpleDll.h"
#pragma comment(lib, "SimpleDll.lib")
int _tmain(int argc, _TCHAR* argv[])
{
printf("%d", Add(10, 30)); // Give the expected result 40
return 0;
}
```
However, when I call `GetProcAddress` to get it's address, it doesn't work!
```
// TestSimpleDll2.c
#include "stdafx.h"
#include <windows.h>
#include "SimpleDll.h"
#pragma comment(lib, "SimpleDll.lib")
int _tmain(int argc, _TCHAR* argv[])
{
printf("%d", Add(10, 30)); // Give the expected result 40
HMODULE hModule = GetModuleHandleA("SimpleDll.dll"); // hModule is found
PROC add_proc = GetProcAddress(hModule, "Add"); // but Add is not found !
// add_proc is NULL!
return 0;
}
```
Thanks for your help. (PS: I use VS2010 on Windows7)
Update:
This is what the depedency walker show for the `SimpleDll.dll` file:

|
Why GetProcAddress doesn't work?
|
CC BY-SA 3.0
| 0 |
2011-04-16T05:44:21.460
|
2011-09-29T14:56:56.357
|
2011-09-29T14:56:56.357
| 500,584 | 325,241 |
[
"c++",
"windows",
"visual-studio",
"winapi",
"name-decoration"
] |
5,684,749 | 1 | null | null | 10 | 5,242 |
I'm doing some stylistic text inside of rounded divs, where the text bumps right up against the top of the container. I've been able to control almost all content, nested divs, images set as backgrounds, etc, and had them all clip successfully, but this one has been giving me serious grief.
Using the old-school image borders or cover-ups is not a solution as we have dynamic graphical backgrounds. We need a solution to clip the text.
This is mostly visible in and older versions of
Here's the sample code to play with:
[http://jsfiddle.net/vfp3v/1/](http://jsfiddle.net/vfp3v/1/)
```
div {
-moz-border-radius: 45px;
border-radius: 45px;
background-color: #ccc;
font-size: 100px;
color: #777;
line-height: 70%;
overflow: hidden;
width: 257px;
}
```
the jank:

Notice it's been fixed in the new Chrome and FireFox 4 - the shui:

Most of our site users are Firefox 3.6, so would love to be able to provide an elegant solution for them as well. Any help appreciated! Cheers
|
border-radius; overflow: hidden, and text is not clipped
|
CC BY-SA 3.0
| 0 |
2011-04-16T05:48:19.113
|
2011-04-16T21:18:49.783
|
2011-04-16T21:18:49.783
| 432,448 | 432,448 |
[
"firefox",
"google-chrome",
"clipping",
"css"
] |
5,684,929 | 1 | null | null | 0 | 3,418 |
I am using zend form and zend decorator to create a form. and I want to set a image after a text box. like this:

I am using zend decorator but it is giving me like this:

I am using this code:
> Class CountryController extends Zend_Controller_Action
{
```
public $textimage = array(
'ViewHelper',
array('FormElements',array('tag'=>'img')),
'FormElements',
array(array('openerror' => 'HtmlTag'),array('tag' => 'td', 'openOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND,'width'=>'37%')),
'Errors',
array(array('closeerror' => 'HtmlTag'),array('tag' => 'td', 'closeOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
array(array('elementImg' => 'HtmlTag'), array('tag' => 'img','class'=>'imgpos')),
array('HtmlTag', array('tag' => 'td','align'=>'left')),
array('Label', array('tag' => 'td')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr','valign'=>'top','align'=>'right')),
);
public $elementDecorators = array(
'ViewHelper',
'FormElements',
array(array('openerror' => 'HtmlTag'),array('tag' => 'td', 'openOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
'Errors',
array(array('closeerror' => 'HtmlTag'),array('tag' => 'td', 'closeOnly' => true, 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
array('HtmlTag', array('tag' => 'td', 'class' => 'element','align'=>'left','colspan'=>'2')),
array('Label', array('tag' => 'td')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr','valign'=>'top','align'=>'right')),
);
public $buttonDecorators = array(
'ViewHelper',
'Errors',
'FormElements',
array('HtmlTag', array('tag' => 'td','align'=>'left')),
array(array('row' => 'HtmlTag'), array('tag' => 'div')),
);
public $addButton = array(
'ViewHelper',
'Errors',
'FormElements',
array('HtmlTag', array('tag' => 'td','align'=>'right')),
array(array('row' => 'HtmlTag'), array('tag' => 'div')),
);
```
//======================add action for country============================
public function addAction()
{
```
$request = $this->getRequest();
$form = new Zend_Form;
$form->setAction('add')
->setMethod('POST')
->setAttrib('Name','addfrm')
->setAttrib('Id','addfrm');
$form->addElements(array(
new Zend_Form_Element_Text('cou_name',array(
'decorators' => $this->textimage,
'required' => true,
'label' => 'Country Name :',
'class'=>'textpos',
'validator'=>'Alpha',
)),
new Zend_Form_Element_Textarea('description',array(
'decorators' => $this->textimage,
'required' => true,
'label' => 'Country Description :',
'rows'=>10,
'cols'=>40,
'validator'=>'NotEmpty',
'class'=>'textpos',
)),
new Zend_Form_Element_Checkbox('block',array(
'decorators' => $this->elementDecorators,
'Label'=>'Block :',
'Value'=>'1',
)),
new Zend_Form_Element_Radio('block_r',array(
'decorators' => $this->elementDecorators,
'Label'=>'Block :',
'multiOptions'=>array(0=>'Yes',1=>'No'),
'Separator'=>'',
)),
new Zend_Form_Element_Submit('add',array(
'decorators' => $this->addButton,
'Label'=>'Add',
)),
new Zend_Form_Element_Button('back',array(
'decorators' => $this->buttonDecorators,
'Label'=>'Back',
'onclick'=>'window.location="list"',
)),
));
$form->setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' => 'table','align'=>'center','class'=>'tbcss','width'=>'84%')),
'Form',
```
));
```
$this->view->assign('form',$form);
```
}
}
I am using IE6.
the generated code is this:
```
<div class="container">
<form enctype="application/x-www-form-urlencoded" action="add"
method="post" Name="addfrm" Id="addfrm" name="">
<table align="center" class="tbcss" width="84%">
<tr valign="top" align="right">
<td id="cou_name-label"><label for="cou_name" class="required">Country
Name :</label></td>
> <td align="left"><img class="imgpos"> <input type="text"
> name="cou_name" id="cou_name" value="" class="textpos"
> validator="Alpha" />
> <td width="37%"></td>
> </img></td>
</tr>
<tr valign="top" align="right">
<td id="description-label"><label for="description"
class="required">Country Description :</label></td>
<td align="left"><img class="imgpos"> <textarea
name="description" id="description" rows="10" cols="40"
validator="NotEmpty" class="textpos"></textarea>
<td width="37%"></td>
</img></td>
</tr>
<tr valign="top" align="right">
<td id="block-label"><label for="block" class="optional">Block
:</label></td>
<td class="element" align="left" colspan="2"><input type="hidden"
name="block" value="0" /><input type="checkbox" name="block"
id="block" value="1" checked="checked" />
<td></td>
</td>
</tr>
<tr valign="top" align="right">
<td id="block_r-label"><label class="optional">Block :</label></td>
<td class="element" align="left" colspan="2"><label
for="block_r-0"><input type="radio" name="block_r"
id="block_r-0" value="0" />Yes</label><label for="block_r-1"><input
type="radio" name="block_r" id="block_r-1" value="1" />No</label>
<td></td>
</td>
</tr>
<div>
<td align="right"><input type="submit" name="add" id="add"
value="Add" /></td>
</div>
<div>
<td align="left">
<button name="back" id="back" type="button"
onclick=
window.location = "list";
Back</button>
</td>
</div>
</table>
</form>
</div>
```
Can anyone help me plz.
|
set image after text box in zend form using zend decorator
|
CC BY-SA 3.0
| 0 |
2011-04-16T06:31:41.647
|
2011-04-16T11:34:39.623
|
2011-04-16T09:46:15.910
| 550,991 | 550,991 |
[
"php",
"zend-framework",
"zend-form",
"zend-decorators"
] |
5,684,995 | 1 | null | null | 4 | 2,702 |
I want to get position(x,y) of a tick in x-axis of a graph to manual draw a line according it, please help me!
Please view below image to get my clearly question:

|
How do I determine the position of a tick in x-axis of a graph?
|
CC BY-SA 3.0
| null |
2011-04-16T06:49:53.673
|
2011-04-17T12:53:33.310
|
2011-04-16T08:30:34.790
| 240,622 | 240,622 |
[
"excel",
"vba",
"graph"
] |
5,685,103 | 1 | 5,848,296 | null | 7 | 4,052 |
I'd like to be able to put a gtk.ProgressBar in my gtk.Menu, but since menus only takes gtk.MenuItems and its subclasses, what I've done instead is take a plain gtk.MenuItem and tried adding my progress bar as a child to that. Since gtk.MenuItem is a subclass of gtk.Bin, it should be able to hold pretty much any widget.
Example:
```
menu = gtk.Menu()
item = gtk.MenuItem()
button = gtk.ProgressBar()
button.pulse()
button.show()
item.add(button)
item.show()
menu.append(item)
```
This runs just fine without pygtk complaining at all. However, my progress bar is simply not shown:

If I replace the progressbar with a gtk.Label, it's shown just fine.
Now to my questions:
1. How do I know which widgets it will take?
2. How do I trick it into letting me put other widgets in there?
|
Putting other widgets in gtk.Menu
|
CC BY-SA 3.0
| 0 |
2011-04-16T07:21:41.810
|
2011-05-01T12:19:45.033
| null | null | 133,416 |
[
"python",
"pygtk",
"appindicator"
] |
5,685,355 | 1 | 5,685,413 | null | 5 | 15,828 |
I have two cases when I would need to set DateTime field in Sql to null. I use C# and LINQ to SQL Classes. I read many questions on stackoverflow which are like my question but still I feed mine a bit different.
When we insert a new customer.
Corresponding code:
```
Customer customer = new Customer();
customer.CustomerName = txt_name.Text;
customer.DOB = dtp_dob.Checked ? DateTime.Parse(dtp_dob.Value.ToString("yyyy-MM-dd")) : //send null here;
```
customer.DOB is System.DateTime.
What I tried is:
```
customer.DOB = dtp_dob.Checked ? DateTime.Parse(dtp_dob.Value.ToString("yyyy-MM-dd")) : SqlDateTime.Null;
```
But this will not succeed as SqlDateTime cannot be converted to System.DateTime.
```
DateTime? nullDateTime = new DateTime();
customer.DOB = dtp_dob.Checked ? DateTime.Parse(dtp_dob.Value.ToString("yyyy-MM-dd")) : nullDateTime.Value
```
In this case, build succeeds but it will throw an SqlDateTime overflow exception.
So then how to pass null value
Property of DOB Member in LINQ Dataclass

Many of them suggest to set Auto Generated Value to true and not to insert any value. True, it works in insert cases.
But now assume, there is already a customer entry where some datetime value is set to DOB field. Now user wants to clear this value (remove the birthdate), then in this case I have to pass a null value using UpdateOn to clear the datetime filed in corresponding customer row.
Thank you very much in advance :)
|
How to set Sql DateTime to null from LINQ
|
CC BY-SA 3.0
| null |
2011-04-16T08:34:10.177
|
2011-04-16T08:50:19.947
|
2020-06-20T09:12:55.060
| -1 | 395,500 |
[
"c#",
"linq",
"linq-to-sql",
"datetime",
"null"
] |
5,685,590 | 1 | null | null | 1 | 1,826 |
I create an ImageSwitcher by code:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#FFFFFF"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Gallery
android:id="@+id/Gallery01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"></Gallery>
<ImageSwitcher
android:id="@+id/ImageSwitcher01"
android:background="@android:color/transparent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ImageSwitcher>
</LinearLayout>
```
But when I run this, this ImageSwitcher background still BLACK, not transprent as I expected. How do I fix it?

|
Cannot make Android ImageSwitcher background transparent
|
CC BY-SA 3.0
| null |
2011-04-16T09:35:14.170
|
2013-06-05T08:38:36.073
| null | null | 190,309 |
[
"android"
] |
5,685,672 | 1 | 5,727,100 | null | 1 | 1,414 |
I have 3 divs containing each other like a [Matryoshka doll](http://en.wikipedia.org/wiki/Matryoshka_doll).

For all divs, I've a function bound the mousenter event. Now moving the mouse from the bottom, and entering into layer three will result in the following events:
1. Mouseenter layer one
2. Mouseenter layer two
3. Mouseenter layer three
Which is perfect, and the expected result, as you need to enter layer one first, in order to enter layer two, etc.
However if I do the same with a mouse movement, the order will be unspecified, for example:
1. Mouseenter layer two
2. Mouseenter layer one
3. Mouseenter layer three
Which doesn't make too much sense to me - how can your mouse enter layer two entering layer one?
Anyway, the question is: is there any way to force jQuery or javascript in general to fire these events in their natural order? If no, can you suggest me a workaround, like somehow post sorting the events from my event handler function, and postponing those that were prematurely called?
Test code is posted at [http://jsbin.com/ibepu6/4/](http://jsbin.com/ibepu6/4/)
|
Why are jQuery mouseenter events triggered in an unspecified order?
|
CC BY-SA 3.0
| null |
2011-04-16T09:47:32.660
|
2011-04-20T07:44:33.317
| null | null | 405,481 |
[
"javascript",
"jquery",
"events",
"event-handling",
"mouseenter"
] |
5,685,924 | 1 | 5,685,938 | null | 0 | 1,373 |
Hi I need to find the the average annual salary using the salary per month data.
I know one can use another column for the salary per year and work it out, but I do not want to, since I am trying to make the application as efficient as possible.

Thanks
|
How to find the average of the annual salary using the month's salary in Excel?
|
CC BY-SA 3.0
| null |
2011-04-16T10:32:26.033
|
2011-04-25T05:11:39.930
|
2011-04-25T05:11:39.930
| 13,295 | 350,648 |
[
"excel",
"worksheet-function"
] |
5,685,959 | 1 | null | null | 0 | 639 |
I've taken my first real step into AJAX and I'm using the following call that works fine:
```
function mapSuppliers(customer_id) {
$.get("get.map.points.php", { c_id: customer_id },
function(data){
if (data!='') {
openMapWindow(data);
} else {
alert("Missing map coordinates - cannot display map");
}
});
}
```
My Question - Using Firebug to monitor the process, it makes the call and returns the values as expected. However, the little loading circle that indicates activity continues to spin long after data is returned.
Do I need to close the connection or stop the call? WHy does the circle keep spinning?

|
How do I stop AJAX query?
|
CC BY-SA 3.0
| null |
2011-04-16T10:42:45.713
|
2011-04-17T03:19:29.797
|
2011-04-17T03:19:29.797
| 350,599 | 350,599 |
[
"jquery",
"ajax",
"get"
] |
5,686,069 | 1 | null | null | 1 | 459 |
I have read this [question](https://stackoverflow.com/questions/2156913/does-protected-inheritance-allow-the-derived-class-access-the-private-members-of),
I still have doubts in my concepts of inheritance.I have tried to solve a homework assignment but I think that I still don't get the access levels. I have following questions in my mind,
> Is and
access specifier same? (I don't find a
difference)
My is attached below,please help me out if it is incorrect.


|
Need Help in Inheritance
|
CC BY-SA 3.0
| 0 |
2011-04-16T11:08:51.903
|
2011-04-16T12:53:50.123
|
2017-05-23T12:18:35.763
| -1 | null |
[
"c++",
"oop",
"inheritance"
] |
5,686,191 | 1 | null | null | 0 | 478 |
I need to fetch data from one table (multiple rows) and insert into other table after modifying and adding some new fields.
For example:
> Table 1 itemid, price, qnt,
date_of_dispatchTable2 Invoiceid, Invoicedate,
customer_id, itemid, price, qnt,
total_amt, date_of_dispatch,
grandtotal
Please help me to make it in asp with ms access

|
Batch data insert
|
CC BY-SA 3.0
| null |
2011-04-16T11:35:15.167
|
2011-04-16T13:41:56.013
| null | null | 195,790 |
[
"asp-classic",
"bulkinsert"
] |
5,686,377 | 1 | 5,686,538 | null | 4 | 26,125 |
I have created a method to retrieve some data (lat,lon points) and open a window to map them.
```
function openMapWindow (data) {
alert(data);
var mapForm = document.createElement("form");
mapForm.target = "Map";
mapForm.method = "POST"; // or "post" if appropriate
mapForm.action = "/map.php";
var mapInput = document.createElement("input");
mapInput.type = "text";
mapInput.name = "addrs";
mapInput.value = data;
mapForm.appendChild(mapInput);
document.body.appendChild(mapForm);
window.open("", "Map", "status=0,title=0,height=600,width=800");
mapForm.submit();
}
```
data variable is populated with the following:

Yet I get the following area on the line:
```
mapInput.value = data;
```
> ERROR: uncaught exception:
[Exception... "Component returned
failure code: 0x80004005
(NS_ERROR_FAILURE)
[nsIDOMHTMLFormElement.submit]"
nsresult: "0x80004005
(NS_ERROR_FAILURE)" location: "JS
frame :: [http://www.xxx.xxx](http://www.xxx.xxx) ::
openMapWindow :: line 244" data: no]Line 0
|
0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLFormElement.submit]
|
CC BY-SA 3.0
| 0 |
2011-04-16T12:11:29.480
|
2011-04-16T13:25:22.117
|
2011-04-16T12:18:34.897
| 350,599 | 350,599 |
[
"javascript",
"dom"
] |
5,686,506 | 1 | null | null | 1 | 508 |
I was wondering how to create a navigation bar
like the one at the top of the screen that moves when "flicked" or scrolled.

|
Scrolling Navigation Bar Help Android
|
CC BY-SA 3.0
| null |
2011-04-16T12:34:56.530
|
2011-04-16T13:20:55.943
| null | null | 656,944 |
[
"android",
"eclipse"
] |
5,686,532 | 1 | 5,742,696 | null | 4 | 10,882 |
We have many questions on stackoverflow regarding uninstallation of Windows Service. After trying all of them I still fail to uninstall the windows service on new version Installation.
I use setup and deployment project to install/uninstall my project which has a windows service and some other projects.
During installation of newer version, all other projects are successfully re-installed but windows service project fails to Re-install and says:
> Error 1001: The specified service already exists.
I referred [this link](https://stackoverflow.com/questions/451573/how-do-i-eliminate-the-specified-service-already-exists-when-i-install-new-vers/617385#617385) and tried to add code to my Install custom action to Stop the service. If I understood the answer in this link correctly, I have put the code to stop the service inside projectInstaller.cs file of the Service:
```
public override void Install(IDictionary stateSaver)
{
ServiceController sc = new ServiceController("SareeManagerNotifications");
if (sc.Status == ServiceControllerStatus.Running)
sc.Stop();
base.Install(stateSaver);
}
```
Custom action pane looks like:

Where the highlighted part is the Service.
I also went through [this answer](http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/bedbb8bd-dad5-4bcb-a87a-ac69386669b4/) which says to set custom action condition as `NOT PREVIOUSVERSIONSINSTALLED`.

This doesn't work for me. Where am I going wrong ?
Thanks in advance :)
|
How to uninstall Windows service using Custom Uninstaller
|
CC BY-SA 3.0
| 0 |
2011-04-16T12:38:25.910
|
2017-06-02T14:12:23.937
|
2017-06-02T14:12:23.937
| 4,390,133 | 395,500 |
[
"c#",
".net",
"visual-studio",
"windows-services",
"installation"
] |
5,686,589 | 1 | 5,686,651 | null | 15 | 13,423 |
I recently found that dropdownlist events are not shown in properties window.
I was disappointed.
I already hate asp.net designer in visual studio. its slow and full with ugly things like this.
please help me. I need to generate events automatically not to write it by hand.

|
dropdownlist events does not show in properties window asp.net Visual Studio 2010
|
CC BY-SA 3.0
| 0 |
2011-04-16T12:47:37.133
|
2016-02-29T12:58:22.483
| null | null | 299,203 |
[
"asp.net",
"visual-studio",
"visual-studio-2010"
] |
5,686,656 | 1 | 5,686,884 | null | 0 | 10,131 |
I was wondering how you can create buttons like the ones at the bottom of the screen and the home button at the top?

|
Android GUI Help: How to Create custom buttons
|
CC BY-SA 3.0
| 0 |
2011-04-16T12:57:40.167
|
2011-04-16T13:43:46.127
| null | null | 656,944 |
[
"android",
"eclipse",
"user-interface"
] |
5,686,908 | 1 | 5,687,020 | null | 1 | 429 |
What would be a proper css method to make the following so it is the same with the exception that the text input fields vertically line up along their left side?

So the check boxes will still be right up against the input fields and in between the label and input fields, but the input fields still all light up.
Current HTML:
```
<p><label for="search_uri">Uri:</label><input id="search_uri" type="text" name="Uri" /></p>
<p><label for="search_server">Server:</label><input type="checkbox" name="server_like" /><input id="search_server" type="text" name="Server" /></p>
<p><label for="search_host">Host:</label><input id="search_host" type="text" name="Host" /></p>
```
Current CSS:
```
label {
font-size: 90%;
float:left;
width: 15em;
}
```
|
CSS Label, Checkboxs, and Inputform Lineup
|
CC BY-SA 3.0
| null |
2011-04-16T13:48:27.423
|
2011-04-16T14:30:49.967
| null | null | 107,156 |
[
"html",
"css",
"forms"
] |
5,687,428 | 1 | 5,687,591 | null | 2 | 2,457 |
I try to align my view elements. This is very hard because there aligned according to the other elements.

So when I pull the cursor down the whole thing jumps to the next blue dotted line. Is it possible to align them stepless?
|
How to align view elements in interface builder?
|
CC BY-SA 3.0
| 0 |
2011-04-16T15:14:07.027
|
2011-04-16T15:39:03.663
| null | null | 401,025 |
[
"xcode",
"interface-builder"
] |
5,687,637 | 1 | 5,687,667 | null | 1 | 26,162 |
Good day!
I am new to programming and I am a little confused how to ask users to input the date in a web page
I have the form below to ask for dates:

My code is as follows:
```
<form action="<?php print $_SERVER['PHP_SELF']; ?>" method="POST">
<input name="event_startDate" type="text" id="event_startDate" size="17">
<input name="event_endDate" type="text" id="event_endDate" size="17">
<input name="SUBMIT" type="submit" id="submit" value="ADD EVENT">
</form>
```
The format of Mysql is YYYY-MM-DD so I've decided to use it. Now I need to ask the users to input using the YYYY-MM-DD format.
I can just insert the YYYY-MM-DD in the text box but I want the start date to be the date today so instead I plan to this:

My problem is.... I don't know how. How can i insert the date in the textbox with that format using PHP? Can i add a value? But if i add the value, will it change also when the user decided to change the value and press the submit button? Also, how can I do it wherein the hypen (-) is not needed to be edited... I mean it will stay as is and the user just need to input the numbers `- -` .
Your help would be highly appreciated. Thank you.
|
Ask Users to Input the Date using the YYYY-MM-DD format
|
CC BY-SA 3.0
| null |
2011-04-16T15:46:43.567
|
2017-07-06T07:14:21.743
| null | null | 525,965 |
[
"php",
"mysql",
"html"
] |
5,687,870 | 1 | null | null | 0 | 148 |
I am developping an application using an IKImageBrowserView.
Randomly it crashed and the issue is in the IKImageBrowserView:
Here is the stack trace where it fails:
I've seen n the web that this issue is known and fixable, but never seen the solution...

If you have any idea or pointer, your help will be appreciated!
Thanks
|
EXC_BAD_ACCESS with IKImageBrowserView
|
CC BY-SA 3.0
| null |
2011-04-16T16:24:35.420
|
2011-05-10T01:50:32.943
| null | null | 230,632 |
[
"objective-c",
"cocoa",
"exc-bad-access",
"ikimagebrowserview"
] |
5,687,867 | 1 | 5,688,324 | null | 1 | 909 |
I am trying to merge two images using C Sharp's System.Drawing.Graphics.
Here is my code:
```
Point p = new Point(Convert.ToInt32(OffsetX), Convert.ToInt32(OffsetY));
Image i = Image.FromFile("1.jpg");
Image toDraw = Image.FromFile("2.jpg");
using (Graphics g = Graphics.FromImage(i))
{
g.DrawImage(toDraw, p);
g.Save();
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "saved"));
i.Save(Path.Combine("saved", "saved1.jpg"));
}
```
The code works fine, but the second image is enlarged in the output from the program.
Made with Paint:

Made with code above:

|
C# graphics displays the image larger than normal?
|
CC BY-SA 3.0
| null |
2011-04-16T16:23:40.657
|
2011-04-16T17:35:52.087
|
2011-04-16T16:28:50.617
| 505,088 | 633,504 |
[
"c#",
"graphics"
] |
5,687,891 | 1 | null | null | 10 | 13,888 |
I searched a lot of questions about heatmap throughout the site and packages, but I still have a problem.
I have clustered data (kmeans/EM/DBscan..), and I want to create a heatmap by grouping the same cluster. I want the similar color patterns to be grouped in the heatmap, so generally, it looks like a block-diagonal.
I tried to order the data by the cluster number and display it,
```
k = kmeans(data, 3)
d = data.frame(data)
d = data.frame(d, k$cluster)
d = d[order(d$k.cluster),]
heatmap(as.matrix(d))
```
but it is still not sorted and looks like this link: But, I want it to be sorted by its cluster number and looked like this:
Can I do this in R?
I searched lots of packages and tried many ways, but I still have a problem.
Thanks a lot.
|
R: How do I display clustered matrix heatmap (similar color patterns are grouped)
|
CC BY-SA 3.0
| 0 |
2011-04-16T16:28:49.477
|
2011-04-17T15:33:44.060
|
2011-04-17T13:51:25.790
| 602,276 | 704,650 |
[
"r",
"ggplot2",
"heatmap"
] |
5,688,115 | 1 | null | null | 0 | 111 |
I want to make css for iphone .. but I cant.. for example I make a div and gave it width:320 and height: 480px then join from iphone blabla.html.. it look too small
I want full screen (320x480)
sample picture..

|
iphone css help
|
CC BY-SA 3.0
| null |
2011-04-16T17:00:20.563
|
2011-04-16T17:03:10.607
| null | null | 701,855 |
[
"iphone",
"css"
] |
5,688,257 | 1 | 5,688,319 | null | 2 | 9,543 |
I'm a beginner to CSS, and i want to know the best technique to position elements in a form using only CSS. I just can't get my two buttons to align probably beside each other...
Here's my HTML code :
```
<form action="creat_fam.php" method ="post" >
<div id="formWrapper">
<label for="fam_name">Family Name : </label>
<input type="text" placeholder="Family Name" name="fam_name" required>
<br/>
<label for="people_count">People count : </label>
<input type="number" name="people_count" min="1" value="1" required>
<br/>
<label for="location">Location : </label>
<input type="text" name="location" placeholder="location" required>
<br/>
<input type="reset" value="Reset">
<input type="submit" name="submit" value="Done">
</div>
</form>
```
And my CSS code :
```
#formWrapper {
width : 400px;
padding : 15px;
-webkit-box-sizing : border-box;
}
#formWrapper label {
float:left;
margin-bottom : 15px;
line-height: 25px;
}
#formWrapper input[type="text"] , #formWrapper input[type="number"] {
float :right;
margin-bottom : 10px;
padding : 2px;
width : 250px;
height: 25px;
border:1px solid gray;
}
#formWrapper input[name="submit"] , #formWrapper input[type="reset"] {
margin : 0;
width : 90px;
height: 40px;
border : none;
border-radius : 4px;
background : -webkit-gradient(linear , 0 0, 0 100% , from(#7f7f7f) ,to(#535353));
color : lightgray;
font-weight: bold;
cursor : pointer;
}
```
And all i get is this :

Thanks in advance.
|
Positioning elements in a form using CSS
|
CC BY-SA 3.0
| null |
2011-04-16T17:25:09.760
|
2015-01-11T00:33:17.837
| null | null | 195,582 |
[
"html",
"css",
"position"
] |
5,688,791 | 1 | 5,688,928 | null | 114 | 113,385 |
I need to add separators between elements of navigation. Separators are images.

My HTML structure is like: `ol > li > a > img`.
Here I come to two possible solutions:
1. To add more li tags for separation (boo!),
2. Include separator in image of each element (this is better, but it makes possibility that user may click on, example, "Home", but get to "Services", because they are one behind the other and user may accidentally click on separator that belongs to "Services");
What to do?
|
Separators for Navigation
|
CC BY-SA 4.0
| 0 |
2011-04-16T18:57:04.323
|
2021-01-14T02:23:37.560
|
2020-07-11T04:18:50.220
| 6,904,888 | 458,610 |
[
"css",
"navigation",
"usability",
"separator"
] |
5,688,817 | 1 | 5,688,951 | null | 5 | 1,749 |
I'm using this method in order to allow the end user to invite friends:
```
FB.ui({method: 'apprequests', message: 'app message!', data:'tracking information for the user'});
```
The user is prompted with a facebook dialog in which he can choose to invite:
1. All friends
2. my app users (the users that have the app installed/allowed)
3. Friends to Invite (those that don't have the app installed - my goal)
Or in a brief image:

I don't want the end user to have a choice here, only prompt the third option - those that don't have the app.
Can someone point me to the right direction on this?
I'm using php + facebook's php sdk.
|
Facebook api - Invite only those that don't have the app
|
CC BY-SA 3.0
| 0 |
2011-04-16T19:00:05.603
|
2012-05-23T08:05:10.127
| null | null | 537,943 |
[
"php",
"facebook",
"facebook-graph-api"
] |
5,688,919 | 1 | 5,689,094 | null | 1 | 236 |
start point of the line is (0,0). What's the bottom right Coordinates?
Thanks!
---

|
what's the iphone bottom right Coordinates?
|
CC BY-SA 3.0
| null |
2011-04-16T19:17:44.673
|
2011-04-16T23:27:02.563
| null | null | null |
[
"iphone",
"coordinates",
"quartz-2d"
] |
5,689,116 | 1 | 5,689,166 | null | 2 | 254 |
I am making a universal app. And even though I set the autoresizing masks on some of the components I need to "group" them. I want each group to be proportionally repositioned, but not each component. Is it bad or are other ways than add them to invisible UIView's so I can group them.

|
Using UIView as containers
|
CC BY-SA 3.0
| null |
2011-04-16T19:45:24.930
|
2011-04-16T19:52:46.570
| null | null | 454,049 |
[
"iphone"
] |
5,689,107 | 1 | 5,693,911 | null | 2 | 8,622 |
I have a problem with my code that plays a video file. Whenever I play the file in fullscreen mode the playback doesn't occupy all of my screen. Here is the relevant code:
```
NSURL *url = [NSURL fileURLWithPath:@"Somefile.mov"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setFullscreen:YES];
moviePlayer.view.frame = self.switchView.frame;
[self.switchView addSubview:moviePlayer.view];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(playbackStateDidChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:moviePlayer];
[moviePlayer prepareToPlay];
[moviePlayer play];
```
Here is the output I get:

|
MPMoviePlayerController fullscreen mode issue
|
CC BY-SA 3.0
| 0 |
2011-04-16T19:43:58.570
|
2013-03-22T07:08:51.500
|
2012-09-15T14:38:03.290
| 91,282 | null |
[
"iphone",
"ios",
"mpmovieplayercontroller"
] |
5,689,459 | 1 | 5,689,596 | null | 2 | 1,671 |
I would like to place an image into the background of my activities. This image is effectively a circle shaped logo which will be semi-transparent, and should sit behind any other content on the UI. I will also offset it into the bottom corner.
What is the best way I can place this image without it become "squashed" (egg shaped) under varying screen dimensions? My app will operate in portrait mode only.
This is what I'm trying to achieve:

So far, I've placed my circle image onto 3 white rectangle canvases for the popular sized screens `480x854`, `320x480` and `240x320` which seems to work, but I don't think its very solid.
Any tips?
|
What is the best way to have a background image without it becoming distorted/stretch on various screens?
|
CC BY-SA 3.0
| null |
2011-04-16T20:37:03.887
|
2011-04-16T23:38:05.337
| null | null | 155,695 |
[
"android",
"android-2.1-eclair"
] |
5,689,643 | 1 | 5,689,747 | null | 3 | 5,855 |
I have to show a list of divs in a seamless order, thought their heights may vary.
Here's an example:

As you can see, when an element is floated to the left and is positioned next to another float it generates a white space until the next float. This doesn't happen the other way around. I can't seem to find a way around this and as I use javascript to filter out certain elements (divs) I can not create two different columns.
Here's the html/css:
```
<div style="width: 200px;">
<div style="float: left; width: 50%; background-color: green;">
<p>Float1</p>
</div>
<div style="float: left; width: 50%; background-color: blue;">
<p>Float2</p>
<p>expanded</p>
</div>
<div style="float: left; width: 50%; background-color: yellow;">
<p>Float3</p>
<p>expanded</p>
</div>
<div style="float: left; width: 50%; background-color: gray;">
<p>Float4</p>
</div>
<div style="float: left; width: 50%; background-color: red;">
<p>Float5</p>
</div>
</div>
```
Any ideas how to get it to look so that Float1 and Float3 don't have empty room between them?
|
CSS float causes blank space
|
CC BY-SA 3.0
| 0 |
2011-04-16T21:10:33.230
|
2012-08-18T14:24:20.220
| null | null | 222,342 |
[
"css",
"css-float"
] |
5,689,675 | 1 | 5,695,572 | null | 1 | 618 |
I'm trying to use a toolbar in a splitviewcontroller. For some reasons that are unknown to me, the table view on the left is not resized correctly.

If I turn to portrait and open the table view from the toolbar item and then go back to landscape view, the tableview is then displayed properly. I'm not sure why this happens.
This is what I have in the RootViewController:
```
self.navigationController.toolbar.items = [NSArray arrayWithObjects:... nil]; // Setting these to an empty array doesn't change anything
self.navigationController.toolbarHidden = NO;
self.navigationController.toolbar.barStyle = UIBarStyleDefault;
```
I doubt the bug is there, but the complete source code is available on [github](https://github.com/oscardelben/GithubEditor) if there's something obvious to check.
|
Problem with UISPlitViewController toolbar
|
CC BY-SA 3.0
| null |
2011-04-16T21:16:16.753
|
2011-04-17T18:38:59.650
|
2011-04-16T21:36:11.313
| 226,672 | 226,672 |
[
"cocoa-touch",
"ipad"
] |
5,689,733 | 1 | 5,689,840 | null | 0 | 558 |
This is what I want (and what works in Firefox and IE). The arrow image is positioned correctly on the right side of the menu item:

But this is what it looks like in Chrome:

```
<div id="main-nav">
<ul class="tabbed">
<li><a href="#">Link 1 (submenu)</a><span></span></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a></li>
</ul>
</div>
<div class="clearer"> </div>
<div id="sub-nav" style="display:none;">
<ul class="tabbed">
<li><a href="#">Sublink 1</a></li>
<li><a href="#">Sublink 2</a></li>
<li><a href="#">Sublink 3</a></li>
<li><a href="#">Sublink 4 </a></li>
</ul>
<div class="clearer"> </div>
</div>
```
CSS
```
ul.tabbed li {
list-style: none;
margin-top: 0;
}
ul.tabbed {
display: inline;
margin: 0;
}
ul.tabbed li {
float: left;
}
ul.tabbed li span { /*--Drop down trigger styles--*/
width: 17px;
height: 35px;
float: right;
background: url("button.gif") no-repeat;
}
ul.tabbed li span.subhover {
background: url("button-hover.gif") no-repeat;
cursor: pointer;
} /*--Hover effect for trigger--*/
```
You can see the [demo here](http://jsfiddle.net/u9NZn/2/).
I noticed that adding an empty img tag does the trick in Chrome, but I don't think is the proper solution.
```
<div id="main-nav">
<ul class="tabbed">
<li><a href="#">Link 1 (submenu)</a><span></span> <img src="" /> </li>
```
|
Wrong submenu positioning in Chrome
|
CC BY-SA 3.0
| null |
2011-04-16T21:27:20.807
|
2011-04-16T21:50:44.487
| null | null | 129,103 |
[
"jquery",
"html",
"css",
"google-chrome",
"drop-down-menu"
] |
5,689,770 | 1 | null | null | 0 | 900 |
I have a line chart that loads a set of daily values. Some days there is no data, so if I just load the set of values I have, the line chart connects the non-contiguous days with a straight line which renders the chart misleading.
I then adjusted my query to fill in the blank days with null values (using a left join) and that works fine.
The problem I'm having now is that when there is a single day that has a value, but the previous and successive days do not have values, the data is not rendered (it would be a single point). Bar charts would address that particular issue but are not appropriate for this chart.
Example:

If ranking was not measured on the 'gap' days except for 12/15, you would not know there was a value on 12/15.
So one way I believe I can address this is to replace the null values with a value equal to the lowest value in my dataset, which would then show neighborless days as spikes off of the bottom axis. At least I think this will work unless a better idea surfaces.
So my question is: how can I replace the null values with my MIN value after the chart has been bound (or can I bind the data to an intermediate control first to manipulate it and then bind the chart to that). I currently bind the chart to a stored procedure so while i suppose i could do the manipulation there, I suspect it would be much more complicated than iterating through the data set after it was created.
If this were a gridview, I could do it easily in the OnRowUpdating code, but I don't know of any equivalent for the chart control.
Any thoughts?
Thanks.
|
Updating data values in MSChart after binding
|
CC BY-SA 3.0
| null |
2011-04-16T21:33:57.107
|
2011-05-24T08:18:06.290
| null | null | 555,470 |
[
"c#",
".net",
"datasource",
"mschart"
] |
5,689,824 | 1 | 5,689,833 | null | 0 | 223 |
... this

what should I do?
|
How to create button like
|
CC BY-SA 3.0
| null |
2011-04-16T21:44:32.643
|
2011-04-16T22:39:44.353
|
2011-04-16T22:06:38.157
| 115,730 | 1,738,921 |
[
"objective-c",
"xcode",
"button",
"interface-builder",
"nsbutton"
] |
5,689,869 | 1 | 5,689,934 | null | 0 | 931 |
I'm trying to create a application with tabbed interface. For now I have this kind of interface

with this code
```
<Window x:Class="BMG.BackOffice.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="572" Width="776">
<TabControl>
<TabItem>
<TabItem.Header>
<TextBlock>
tab1
</TextBlock>
</TabItem.Header>
<Label>Test for tab1</Label>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock>
tab2
</TextBlock>
</TabItem.Header>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock>
tab3
</TextBlock>
</TabItem.Header>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock>
tab4
</TextBlock>
</TabItem.Header>
</TabItem>
</TabControl>
```
I have already write other windows and I wonder if is it possible to "insert" these windows in the tabs (a window for a tab). So to replace `<Label>Test for tab1</Label>`
by a window (.xaml file)
Thanks for response
|
Add a xaml File in a main tabbed Window
|
CC BY-SA 3.0
| null |
2011-04-16T21:53:42.743
|
2011-04-16T22:14:17.483
| null | null | 142,234 |
[
"c#",
"wpf",
"mdi",
"tabbed-interface"
] |
5,689,904 | 1 | 5,705,965 | null | 36 | 7,518 |
How do you close Explorer programmatically?
By that I mean, how do you invoke this function programmatically:

Edit: Typo in the picture, it should say "Ctrl-Shift-Right-Click" instead of "Shift-Click".
|
Gracefully Exit Explorer (Programmatically)
|
CC BY-SA 3.0
| 0 |
2011-04-16T22:01:56.757
|
2012-08-14T14:38:15.950
|
2011-06-27T02:04:32.423
| 603,977 | 541,686 |
[
"windows",
"winapi",
"exit",
"explorer"
] |
5,690,026 | 1 | 5,690,045 | null | 1 | 864 |
I decided to follow [this](http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs) tutorial on getting started with ASP.NET. I have Visual Web Developer 2010 Express (with SP1) installed, as well as the ASP.NET MVC3 tools.
I created the project and starting debugging it by going to `Debug->Start Debugging` - which then opened my browser to `http://localhost:50531` and displayed:

According to the tutorial, that's not what I'm supposed to see.
- -
|
Why can't I debug this very simple ASP.NET MVC3 application?
|
CC BY-SA 3.0
| null |
2011-04-16T22:21:35.773
|
2011-04-16T22:24:30.933
| null | null | 193,619 |
[
"asp.net-mvc-3",
"http-status-code-404"
] |
5,690,055 | 1 | 5,694,848 | null | 1 | 563 |
I have developed a simple MIDI application that allows me to play MIDI notes, in order for the user to be able to interact with the UI whilst the MIDI sounds are playing I have put the logic necessary in an anonymous subclass like so:
```
public static void Play()
{
new Thread(new Runnable()
{
public void run()
{
if (!_sequencer.isRunning())
{
try
{
_sequencer.setSequence(_sequence);
_sequencer.start();
}
catch (Exception e)
{
Logger.Add(e.getMessage());
}
}
}
}).start();
}
```
Although the music begins to play the UI still fails to respond when I click on a ComboBox for example, I have something similar working fine in C#.
Is there some sort of caveat to thread in Java that would explain the behaviour i'm seeing?
(The Java API I'm using if it helps - [javax.sound.midi](http://download.oracle.com/javase/1.4.2/docs/api/javax/sound/midi/package-summary.html))
Thanks for your time.
Click around the UI a little more and noticed something interesting; everything seems to work fine with exception to two ComboBoxes in the top left most corner, I've tried deleting them and replacing them but makes no difference. The boxes change to blue when clicked (as it would normally) but the drop down box does not appear below it and the colour does not return to it's default when focus is on another UI component. Could it be a bug introduced by NetBeans perhaps?

Well after much trial and error I have finally found the cause of the problem, the threading works great. The problem was that NetBeans has somehow realigned my UI components which causes the Window to fill the screen, manually resizing and testing the ComboBoxes showed that they actually worked fine.
Thanks for everybodys feedback!
|
Running logic in separate thread still locks UI - Java
|
CC BY-SA 3.0
| null |
2011-04-16T22:26:57.750
|
2011-04-17T16:43:49.270
|
2011-04-17T16:41:07.383
| 218,159 | 218,159 |
[
"java",
"multithreading",
"netbeans",
"midi",
"anonymous-class"
] |
5,690,144 | 1 | 5,690,261 | null | 7 | 15,396 |
I've got the following layout file, which has a `GridView` and an `ImageView` behind that as the background.
```
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginRight="-70dp"
android:layout_marginBottom="-50dp"
android:src="@drawable/s_background"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"/>
</LinearLayout>
</FrameLayout>
```
And this is the layout I use for the actual item in each "cell" of the grid :
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/cardInGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:singleLine="true"
android:textSize="40sp"
android:textColor="#660099"
android:typeface="serif"/>
</LinearLayout>
```
I'm seeing the following on my device at the moment :

Is there any way of making each item in the GridView larger, so it fits the size of the screen and I don't have un-used white space at the bottom of the display?
This works fine on an emulator, but on a device the screen resolution is higher, hence getting the white space at the bottom.
Many thanks
|
How can I force a GridView to use the whole screen (regardless of display size)?
|
CC BY-SA 3.0
| 0 |
2011-04-16T22:42:57.623
|
2017-12-08T16:42:52.640
|
2016-11-06T19:54:12.957
| 178,163 | 155,695 |
[
"android",
"gridview",
"android-2.1-eclair",
"android-2.0-eclair"
] |
5,690,169 | 1 | 5,690,236 | null | 4 | 6,832 |
I am trying to make a grid that takes up 100% of the width of the browser window, firstly i am not sure on how to go about this grid and secondly I am wanting a div to have a random position within that grid, but will only fill the position if it is not occupied already.
I guess my question is, how would I go about it and if its even possible.
I'm guessing I would need a db to log all positions?
ps: When I say grid I don't mean 960 grid or any of them framework grids i'm just wanting a simple square grid
although i'm looking for each square to be 15px by 15px and the 'border' to be only 1px
Thanks for your help.
|
Set a div at random position on a grid
|
CC BY-SA 3.0
| null |
2011-04-16T22:49:20.477
|
2011-04-18T22:51:35.383
|
2011-04-18T22:51:35.383
| 536,129 | 536,129 |
[
"php",
"javascript",
"jquery",
"html",
"css"
] |
5,690,240 | 1 | 5,690,436 | null | 0 | 62 |
I am getting an error when trying to send a div to the very end of my site.
I am using a general height:100% and the div then moves to the end of the visible screen, but when I scrolls down to the end of the site, the div remain in the same position.
I want to add the div to the end, but for some reason I couln't do it.
Look at the pic.

My code: [http://www.securebitcr.com/test/site2.php](http://www.securebitcr.com/test/site2.php)
I appreciate any kind of help with it.
Thanks,
|
Error trying to move div to the end of a site
|
CC BY-SA 3.0
| null |
2011-04-16T23:04:10.570
|
2011-04-16T23:58:53.977
| null | null | 607,567 |
[
"css",
"html"
] |
5,690,147 | 1 | 5,690,364 | null | 3 | 6,430 |
### Technologies being used
- - - -
### Details of the code and code excerpts
I have a drop-down list (country) and a text-box (city) { the drop-down list and text-box are generated by a django-form} that get automatically populated by a GeoIp library
Image of how these UI elements look on the html page:

1. Code excerpt that fills in the drop-down list and the text-box: // selecting users country and users city, // the id for users country drop-down list is "id_country_name" // the id for users city text-box is id_city_name $(function () { $("#id_country_name").val(geoip_country_name()); $("#id_city_name").val(geoip_city()); // at this point the users country and city values are in from the javascript call // now is the time to call python code to get the data values reported by other users for users country and city });
</script>
2. Sample python code for querying the database def get_data_for_users_country_and_city(self):
query = db.GqlQuery("SELECT * FROM UserReportedCity where county.country_name = country_name and city.city_name = city")
data = query.fetch(10)
I have to probably package these items in a template and then return back to the html page
```
template_values = {
self.__TEMPLATE_DATA_FOR_USER: data
}
#rendering the html page and passing the template_values
self.response.out.write(template.render(self.__MAIN_HTML_PAGE, template_values))
```
Please note, i haven't tested this python code yet.
### Question
Once the values for country and city are filled in by the javascript call, I want to make a call to a python method to get the data for users country and city and populate it in the “Your City” tab.
Tried the suggestions given by @Fabio Diniz and @Kevin P
The following is the html and javascript code:
```
<!-- script snippet to fill in users country and city value by making a calls to the geoip library -->
<script type="text/javascript">
// selecting users country and users city,
// the id for users country drop-down list is "id_country_name"
// the id for users city text-box is id_city_name
$(function () {
$("#id_country_name").val(geoip_country_name());
$("#id_city_name").val(geoip_city())
});
$.post("/AjaxRequest/get_data_for_users_country_city", {
selected_country_name: document.getElementById('id_country_name').value,
selected_city_name: document.getElementById('id_city_name').value
},
function(data) {
alert("hello");
}
);
</script>
```
The following indicates that the requests to "/AjaxRequest/get_data_for_users_country_city" should go to “AjaxRequest” class.
```
def main():
application = webapp.WSGIApplication([('/', MainPage),
('/UserReporting', UserReporting),
('/AjaxRequest/get_data_for_users_country_city', AjaxRequest )
],
debug=False)
run_wsgi_app(application)
```
Code in “AjaxRequest” class
```
from google.appengine.ext import db
class AjaxRequest(webapp.RequestHandler):
def post(self):
user_reported_country_get = self.request.get('selected_country_name')
user_reported_city_get = self.request.get('selected_city_name')
data_for_users_country_city = self.get_data_for_users_country_and_city(user_reported_country_get, user_reported_city_get)
self.response.out.write (data_for_users_country_city)
```
In debug mode i can see that the call from javascript method making it to the "AjaxRequest", "post" method. The problem is that the “user_reported_country_get” and “user_reported_city_get” don’t have the string values given by the javascript code.
Based on the suggestion given by @Matt Ball, I tried the following code excerpt in the javascript call
```
<!-- script snippet to fill in users country and city value by making a calls to the geoip library -->
<script type="text/javascript">
// selecting users country and users city,
// the id for users country drop-down list is "id_country_name"
// the id for users city text-box is id_city_name
$(function () {
$("#id_country_name").val(geoip_country_name());
$("#id_city_name").val(geoip_city())
});
$.post("/AjaxRequest/get_data_for_users_country_city", {
selected_country_name: $('#id_country_name').val(),
selected_city_name: $('#id_city_name').val()
},
function(data) {
alert("hello");
}
);
</script>
```
HTML code excerpt for country drop-down list and city text-box. Here the id for the country drop-down list is "id_country_name" and the city text-box is "id_city_name"
```
<div id="userDataForm">
<form method="POST" action="/UserReporting">
<table>
<!-- Printing the forms for users country, city -->
<tr><th><label for="id_country_name">Country name:</label></th><td><select name="country_name" id="id_country_name">
<option value="" selected="selected">---------</option>
<option value="Afghanistan">Afghanistan</option>
</select></td></tr>
<tr><th><label for="id_city_name">City name:</label></th><td><input type="text" name="city_name" id="id_city_name" /></td></tr>
</table>
</form>
```
Inside the python debugger the values for “select_country_name” and “selected_city_name” are still empty as depicted by the following image

I thought that for some reason during the call to python happens before the "id_country_name" and "id_city_name" values are filled in. So rather than trying to give the values of "id_country_name" and "id_city_name", i directly passed the values of geoip_country_name() and geoip_city(). This successfully passed the country name and city name back to python code.
Here is the code excerpt i tried.
```
<!-- script snippet to fill in users country and city value by making a calls to the geoip library -->
<script type="text/javascript">
// selecting users country and users city,
// the id for users country drop-down list is "id_country_name"
// the id for users city text-box is id_city_name
$(function () {
$("#id_country_name").val(geoip_country_name());
$("#id_city_name").val(geoip_city())
});
$.post("/AjaxRequest", {
selected_country_name: geoip_country_name(),
selected_city_name: geoip_city()
},
function(data) {
alert($('#id_country_name').val());
alert($('#id_city_name').val())
}
);
</script>
```
Based on the feedback given by @hyperslug, I moved the “$.post("/AjaxRequest" “ piece inside the function which sets the users country drop-down list and users city text-box.
This code correctly passes users country and city to python code.
Javascript code excerpt:
```
<!-- script snippet to fill in users country and city value by making a calls to the geoip library -->
<script type="text/javascript">
// selecting users country and users city,
// the id for users country drop-down list is "id_country_name"
// the id for users city text-box is id_city_name
$(function () {
//finding the users country and city based on their IP.
var $users_country = geoip_country_name()
var $users_city = geoip_city()
// setting the drop-down list of country and text-box of the city to users country and city resp
$("#id_country_name").val($users_country);
$("#id_city_name").val($users_city);
//since we have users country and city, calling python class to get the data regarding users country and city combination
$.post("/AjaxRequest", {
selected_country_name: $users_country,
selected_city_name: $users_city
})
});
</script>
```
|
Calling a python method to fetch data, from a javascript function on the html page
|
CC BY-SA 3.0
| 0 |
2011-04-16T22:43:05.473
|
2011-04-17T20:13:37.240
|
2011-04-17T20:13:37.240
| 639,582 | 639,582 |
[
"javascript",
"python",
"google-app-engine"
] |
5,690,568 | 1 | 5,720,549 | null | 1 | 1,788 |
I came back from MIX 11, installed the new MVC Tools update, and now my Visual Studio 2010 New Project dialog looks like this. This is a serious problem that I have been unable to resolve after a full remove & reinstall of VS 2010 Ultimate. System restores have been unable to resolve this issue either.
I've also tried running devenv /installvstemplates, nothing seems to work.
Also, when opening an existing project, the Add Library Package Reference command causes error "TYPE_E_CANTLOADLIBRARY".
This is a SERIOUS PROBLEM, please help!

|
Why is my Visual Studio 2010 New Project dialog broken?
|
CC BY-SA 3.0
| 0 |
2011-04-17T00:14:41.180
|
2014-07-23T18:32:12.470
|
2011-04-17T08:08:19.670
| 366,904 | 304,832 |
[
"visual-studio",
"visual-studio-2010"
] |
5,690,659 | 1 | 5,691,230 | null | 4 | 122 |
Consider the following:
```
printMessage[cellexpr_]:=CellPrint@Cell[cellexpr,"Message",
CellLabel->"(slave Kernel)",ShowCellLabel->True,
CellFrameMargins->0,Background->LightBrown,
CellLabelAutoDelete->False];
printMessage[BoxData[RowBox[{RowBox[{"Sin", "::", "\"argx\""}], ": ",
"\"\\!\\(Sin\\) called with \\!\\(2\\) arguments; 1 argument is expected.\""}],
StandardForm]]
Sin[1,1];
```
-->
```
(slave Kernel) Sin::argx: Sin called with 2 arguments; 1 argument is expected.
During evaluation of In[1]:= Sin::argx: Sin called with 2 arguments;
1 argument is expected. >>
```

One can see that the auto-generated `Message` inherits the style of the previous printed `Cell`. Why this happens? And how to prevent this?
|
Problem with Message styling
|
CC BY-SA 3.0
| null |
2011-04-17T00:41:58.420
|
2011-04-17T09:43:33.640
|
2011-04-17T02:50:42.927
| 590,388 | 590,388 |
[
"wolfram-mathematica",
"mathematica-frontend"
] |
5,690,663 | 1 | 5,690,699 | null | 5 | 63,969 |
I have to create a class called with 2 private fields . And a public constructor that sets Numerator and Denominator to 1 by default. I have included 4 members functions in my my class: Sum, Difference, Product, Division.
Then I am not sure what to do next. Why does book show fraction equivalences? What do I have to do with that? I guess a very important question would be what parameters should my member functions take?
Also what would be a good way to prohibit denominator of 0? Throw exception or force it to be equal to 1?

```
#include <iostream>
using namespace std;
class Fraction
{
private:
int numerator, denominator;
public:
Fraction()
{
numerator = 1;
denominator = 1;
}
Fraction(int n, int d)
{
numerator = n;
if (d==0)
{
cout << "ERROR: ATTEMPTING TO DIVIDE BY ZERO" << endl;
exit(0); // will terminate the program if division by 0 is attempted
}
else
denominator = d;
}
/*In the following functions I am dividing both numerator and denominator by the gcd function.
GCD function accepts both numerator and denominator values. If we had 2 fractions, 1/2 and 1/4
and we passed it into the Sum, the result would be n=6 and d=8. These are the values that GCD
function will accept, find greatest common divisor and return the integer value of 2. In my case
am diving both numerator and denominator on the same line by the greatest common divisor. Although
it probably would be more efficient to create a local int variable and store GCD value in it, but
for such small program it shouldn't make any difference.*/
Fraction Sum(Fraction otherFraction)
{
int n = numerator*otherFraction.denominator+otherFraction.numerator*denominator;
int d = denominator*otherFraction.denominator;
return Fraction(n/gcd(n,d),d/gcd(n,d));
}
Fraction Difference(Fraction otherFraction)
{
int n = numerator*otherFraction.denominator-otherFraction.numerator*denominator;
int d = denominator*otherFraction.denominator;
return Fraction(n/gcd(n,d),d/gcd(n,d));
}
Fraction Product(Fraction otherFraction)
{
int n = numerator*otherFraction.numerator;
int d = denominator*otherFraction.denominator;
return Fraction(n/gcd(n,d),d/gcd(n,d));
}
Fraction Division(Fraction otherFraction)
{
int n = numerator*otherFraction.denominator;
int d = denominator*otherFraction.numerator;
return Fraction(n/gcd(n,d),d/gcd(n,d));
}
// I got the GCD algorithm from the following source:
// Source C#: http://www.ww.functionx.com/csharp2/examples/gcd.htm
int gcd(int n, int d)
{
int remainder;
while (d != 0)
{
remainder = n % d;
n = d;
d = remainder;
}
return n;
}
void show() // Display method
{
if (denominator == 1) // e.g. fraction 2/1 will display simply as 2
cout << numerator << endl;
else
cout << numerator << "/" << denominator << endl;
}
};
int main()
{
Fraction a(1,2);
Fraction b(1,4);
Fraction c;
c = a.Sum(b); // Result: 3/4
c.show();
c = a.Difference(b); // Result: 1/4
c.show();
c = a.Product(b); // Result: 1/8
c.show();
c = a.Division(b); // Result: 2
c.show();
return 0;
}
```
|
C++ Fractions Class
|
CC BY-SA 3.0
| 0 |
2011-04-17T00:42:44.813
|
2021-04-29T01:10:39.533
|
2011-04-22T03:30:39.260
| 274,117 | 274,117 |
[
"c++"
] |
5,690,943 | 1 | 5,691,091 | null | 0 | 2,774 |
I'm trying to learn some canvas in html5 and javascript and I want to create those typical Illustrator sun rays:

But my problem is that I want to automate it and make it full screen.
To calculate the coordinates of the points in the middle isn't hard, it's the outer points that I cant seem to get a grip on.
K, so this is what I got.
The problem lies in the for-loop for creating an array for the outer coordinates.
So it starts calculating from the center of the screen.
If it's the first point (we ignore the inner points for now) it takes the x_coordinate variable (which is the horizontal center of the screen) and adds the width_between_rays divided by two (because I want to mimic the picture above with some space between the two upper rays).
The rest of the points are checked if they are divided by two to see if I should add the width_between_rays (should probably be offset or something) or the width_of_rays to the last points cordinates.
Well this seems pretty straight forward but since the window size isn't a fixed size I need some way of calculating where the point should be if, for example; the position of a point is outside the width/height of the screen.
So my way of calculating this doesn't work (I think).
Anyways, can someone (who's obviously smarter than me) point me in the right direction?
```
function sun_rays(z_index, element, color, number_of_rays, width_of_rays, width_between_rays) {
// Start the canvas stuff
var canvas = document.getElementById(element);
var ctx = canvas.getContext("2d");
console.log();
ctx.canvas.width = $(window).width();
ctx.canvas.height = $(window).width();
ctx.fillStyle = color;
// calculate the window size and center position
var window_width = $(window).width();
var window_hight = $(window).height();
var x_coordinate = window_width / 2;
var y_coordinate = window_hight / 2;
// create an array for the center coordinates
var center_coordinate_array = new Array();
for(i=0; i < number_of_rays; i++){
center_coordinate_array[i] = new Array(x_coordinate, y_coordinate);
}
// create an array for the outer coordinates
var outer_coordinate_array = new Array();
for(i=1; i == number_of_rays*2; i++){
if(i == 1) {
// X
var last_outer_x_coordinate = x_coordinate + (width_between_rays/2);
// Y
if(last_outer_x_coordinate < window_width) {
last_outer_y_coordinate = last_outer_y_coordinate;
} else {
$x_coordinate_difference = last_outer_x_coordinate - window_width;
last_outer_y_coordinate = x_coordinate_difference;
}
center_coordinate_array[i] = new Array(last_outer_x_coordinate, last_outer_y_coordinate);
} else {
if(i % 2 == 0) {
// X
last_outer_x_coordinate = last_outer_x_coordinate + width_of_rays;
// Y
//calculate the y position
center_coordinate_array[i] = new Array(last_outer_x_coordinate);
} else {
// X
last_outer_x_coordinate = last_outer_x_coordinate + width_between_rays;
// Y
//calculate the y position
center_coordinate_array[i] = new Array(last_outer_x_coordinate);
}
}
}
}
```
|
calculate the x, y position of a canvas point
|
CC BY-SA 3.0
| null |
2011-04-17T01:53:48.677
|
2011-04-19T15:10:53.327
| null | null | 630,413 |
[
"javascript",
"html",
"canvas"
] |
5,690,982 | 1 | 5,691,002 | null | 0 | 292 |
Inside my cellForRowAtIndexPath method, I would like to dynamically create some buttons and place them next to each other in the cells. The problem I'm running into is that the sizeToFit method always puts the x coordinate at the 0 position. Is there a way to offset the position to put it next to the previous button?
Instead of this: . I get this: 
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"cell"] autorelease];
cell.accessoryType = UITableViewCellAccessoryNone;
if ([indexPath section] == 0) {
UIButton *buttonClean = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[buttonClean addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[buttonClean setTitle:@"Clean Cup" forState:UIControlStateNormal];
[buttonClean sizeToFit];
[cell addSubview:buttonClean];
UIButton *buttonAroma = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[buttonAroma addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[buttonAroma setTitle:@"Aroma" forState:UIControlStateNormal];
[buttonAroma sizeToFit];
[cell addSubview:buttonAroma];
```
|
Offsetting UIButton frames in a tableview row
|
CC BY-SA 3.0
| null |
2011-04-17T02:04:52.820
|
2011-04-17T04:38:39.113
|
2011-04-17T04:38:39.113
| 269,778 | 269,778 |
[
"iphone",
"ios4",
"uitableview",
"uibutton"
] |
5,691,258 | 1 | 5,691,548 | null | 0 | 421 |
What I'm referring to is a documented bug: [http://www.google.com/support/forum/p/apps-apis/thread?tid=58c4f7fbe60be52c&hl=en](http://www.google.com/support/forum/p/apps-apis/thread?tid=58c4f7fbe60be52c&hl=en). Basically, when I use an older Android emulator or device, I do get a mobile-sized page for authorization: , whereas with a level 8 (Android 2.2) emulator, it shows an unreadable page: .
Has anyone found a fix for this? All I know is to add btmpl=mobile to the authentication query during the OAuth process, and apparently that's not enough. The login (authentication) page shows up fine, mobile-style, on both old and new emulators and devices; it's just the authorization page that's a problem.
|
how to make Google OAuth honor btmpl=mobile?
|
CC BY-SA 3.0
| null |
2011-04-17T03:33:23.157
|
2011-04-17T04:48:32.193
|
2011-04-17T04:08:46.347
| 493,161 | 493,161 |
[
"android",
"oauth",
"android-emulator",
"google-api"
] |
5,691,287 | 1 | 12,014,032 | null | 0 | 861 |
I'm trying to print newline into textarea.
I have this string:
`$coords = $row->lat.','.$row->lon."\r\n"`
When I use the following javascript command:
```
alert(coords);
```
I get:
```
-35.308401,149.124298
-35.307841,149.124298
```
However, when I view it in a textarea, I get:
```
-35.308401,149.124298 -35.307841,149.124298
```
How do I make the newlines display in the textarea?
alert window display:

textarea:

Code:
```
<textarea name="addrs" rows=5 cols=80>-35.308401,149.124298 -35.307841,149.124298</textarea>
```
This is how form is created and text written to textarea
```
function openMapWindow (data) {
alert(data);
var mapForm = document.createElement("form");
mapForm.target = "Map";
mapForm.method = "POST"; // or "post" if appropriate
mapForm.action = "http://www.xxx.com/map.php";
var mapInput = document.createElement("input");
mapInput.type = "text";
mapInput.name = "addrs";
mapInput.value = data;
mapForm.appendChild(mapInput);
document.body.appendChild(mapForm);
map = window.open("", "Map", "status=0,title=0,height=600,width=800,scrollbars=1");
if (map) {
mapForm.submit();
} else {
alert('You must allow popups for this map to work.');
}
}
function mapSuppliers(customer_id) {
$.get("get.map.points.php", { c_id: customer_id },
function(data){
if (data!='') {
openMapWindow(data);
} else {
alert("Missing map coordinates - cannot display map (data: " + data + ")");
}
});
}
```
|
PHP print newline into textarea
|
CC BY-SA 3.0
| null |
2011-04-17T03:40:16.457
|
2012-08-18T17:16:02.377
|
2012-08-18T17:16:02.377
| 390,177 | 350,599 |
[
"php",
"javascript",
"html",
"textarea",
"newline"
] |
5,691,481 | 1 | 5,691,495 | null | 1 | 1,544 |
I have an object for like this:
```
var obj = {
c: {
games: {
game1: {
howToPlay: { files: ['instructions.txt'] },
files: ['characters.txt', 'wildCards.txt']
},
game2: { files: ['credits.txt'] }
}
'program files': {
microsoft: { files: ['ieShortcuts.txt'] }
}
logs {
zipped: { files: ['bigfile.txt'] },
files: ['log1', 'log2', 'log3', 'log4', 'log5']
}
...
}
...
}
```
I want to generate a treeview-like structure from this object I want to implement a way to select certain files (with checkboxes next to them, empty for none selected, checked for all, and filled for partially; using <img />) and have the order of files in the same folder sortable.
Something like this:

My end result is to spit back the contents of the selected files in the order that the user specified.
Is there any way to accomplish this through a jQuery plugin or combination of plugins? I started writing this from scratch but the sheer complexity seems beyond me
|
treeview-like jquery plugin
|
CC BY-SA 3.0
| null |
2011-04-17T04:31:36.617
|
2016-02-11T17:28:28.513
| null | null | 465,546 |
[
"javascript",
"jquery",
"jquery-ui",
"plugins",
"jquery-plugins"
] |
5,691,601 | 1 | null | null | 19 | 1,065 |
I've been working on a game in for HTML 5 using the canvas tag, and I've build up quite a code base to cover my requirements. I also want to make sure I'm covering up all my memory leaks.
I have doubts I'm doing it correctly because the feedback I'm getting from Chrome's task manager and profiling tools seem to suggest my cleanup is having no effect in the end.
Here's an image so you can see what I mean:

So as you can see, once I do my cleanup memory usage just freezes and doesn't drop. Is this a memory leak?
When I ran my webpage in the Profiler and checked the heap before and after cleanup it does appear to remove all the references to my objects (and they disappear) but my usage only drops by only a few kilobytes leaving about 1.3mb of arrays, strings, and other objects behind. Is it impossible to catch all this or is there something majorly wrong?
Thanks.
|
When Profiling Javascript in Chrome how do I know I've handled Memory Leaks?
|
CC BY-SA 3.0
| 0 |
2011-04-17T05:03:09.330
|
2013-02-14T12:18:34.733
| null | null | 350,964 |
[
"javascript",
"html",
"google-chrome",
"memory-leaks"
] |
5,691,693 | 1 | 5,694,140 | null | 0 | 812 |
I have write some code but my program is too slow. The problem is as follows:
I'll build Matrix "A" to solve Ax=b problem
I have a sphere(it may be any shape), that is showed by some point,
I have assigned a coordinate vector [x y z] for each point.
N is the number of points.
Please first load (a)
```
clc
[rv,N,d0]=geometrySphere(5e-9,10); %# Nx3 matrix [x1 y1 z1;x2 y2 z2;... ].
%# geometrySphere is a function for replacicg the sphere with points.
L=(301:500)*1e-9; K=2*pi./L; %# 1x200 array
%some constants ==================
I=eye(3);
e0=1;
V=N*d0^3; aeq=(3*V/(4*pi))^(1/3);
E0y=ones(N,1);
E0z=E0y;
Cext=zeros(1,200);
Qext=zeros(1,200);
A=zeros(3,3,N^2);
%=================================
for i=1:N
r(i)=sqrt(rv(i,1)^2+rv(i,2)^2+rv(i,3)^2); %# r is the size of each vector
end
for i=1:N
for j=1:N
dx(i,j)=rv(i,1)-rv(j,1); %# The x component of distance between each 2 point
dy(i,j)=rv(i,2)-rv(j,2);
dz(i,j)=rv(i,3)-rv(j,3);
end
end
d=cat(3,dx,dy,dz); %# d is the distance between each 2 point (a 3D matrix)
nd=sqrt(dx.^2+dy.^2+dz.^2); %# Norm of rv vector
nx=d(:,:,1)./nd; ny=d(:,:,2)./nd; nz=d(:,:,3)./nd;
n=cat(3,nx,ny,nz); %# Unit vectors for points that construct my sphere
for s=1:length(L)
E0x=exp(1i*K(s)*rv(:,1))';
% 1x200 array in direction of x(in Cartesian coordinate system)
% Main Loop =================================================
p=1;
for ii=1:N
for jj=1:N
if ii==jj
A(:,:,p)=a(s)*eye(3); %# 3x3 , a is a 1x200 constant array
p=p+1; %# p is only a counter
else
A(:,:,p)=-exp(1i*K(s)*nd(ii,jj))/nd(ii,jj)*(-K(s)^2*([nx(ii,jj);ny(ii,jj);nz(ii,jj)]...
*[nx(ii,jj) ny(ii,jj) nz(ii,jj)]-I)+(1/nd(ii,jj)^2-1i*K(s)/nd(ii,jj))...
*(3*[nx(ii,jj);ny(ii,jj);nz(ii,jj)]*[nx(ii,jj) ny(ii,jj) nz(ii,jj)]-I));
p=p+1;
end
end
end
%===============================================================
B = reshape(permute(reshape(A,3,3*N,[]),[2 1 3]),3*N,[]).';
%# concatenation of N^2 3x3 matrixes into a 3Nx3N matrix
for i=1:N
E00(:,i)=[E0x(i) E0y(i) E0z(i)]';
end
b=reshape(E00,3*N,1);
P=inv(B)*b;
Cext(s)=(4*pi*K(s))*imag(b'*P);
Qext(s)=Cext(s)/(pi*aeq^2);
end
Qmax=max(Qext); Qext=Qext/Qmax;
L=L*1e9;
plot(L,Qext,'--');figure(gcf)
```
I don't know could I explane clear?
Do you have any suggestion?
Thanks in advance for any suggestions.
[geometrySphere](http://www.text-upload.com/txt.php?id=71701&c=8280446)

Where I is the 3x3 identity matrix and nij nij denotes a dyadic product.

(a) after running a function is:[an 1x200 array](http://www.mediafire.com/?ba5e3a399ur1zf6)
|
Speed up `for` loops or vectorizing them
|
CC BY-SA 3.0
| null |
2011-04-17T05:31:16.323
|
2012-01-25T21:18:17.333
|
2012-01-25T21:18:17.333
| 817,452 | 601,908 |
[
"matlab",
"vectorization"
] |
5,691,841 | 1 | 5,691,972 | null | 1 | 559 |
The Join I have implemented is a basic one, but I can't figure out the issue in my query.
Can you help me to figure out where I have made a mistake?
Here is the scenario:
I have the following tables

and I am writing this query in T-SQL
```
Select
f._id, f.createdby, f.fullname,
f.topictitle, f.topicdate, f.status,
f.totalviews, count(fr._id) as totalResponses
from
forumresponse as fr
RIGHT OUTER Join forum as f ON f._id = fr.forumId
where f.categoryId= @categoryId
group by f._id, f.createdby, f.fullname, f.topictitle,
f.topicdate, f.status, f.totalviews
order by _id desc
```
But everytime I am getting same list of forums for any category.
I am trying to fetch the forum and its details which belongs to a particualr category only.
But whatever the category I am passing I'm getting same list of forum.
|
Help me to create a join based query in SQL Server 2008
|
CC BY-SA 3.0
| 0 |
2011-04-17T06:03:42.997
|
2011-04-17T13:23:40.627
|
2011-04-17T13:23:40.627
| 13,302 | 395,661 |
[
"sql-server",
"join"
] |
5,691,855 | 1 | 5,692,177 | null | 16 | 10,690 |
Is Microformats still a best semantic way to code contact information in a web page?

I asked this question almost 2 years ago and got the answer where Microformat was the best solution. [What is the best method to code physical address in html?](https://stackoverflow.com/questions/1886923/what-is-the-best-method-to-code-physical-address-in-html)
Now today in HTML 5, Is that still the best way?
```
<div class="vcard">
<span class="fn">Gregory Peck</span>
<a class="org url" href="http://www.commerce.net/">CommerceNet</a>
<div class="adr">
<span class="type">Work</span>:
<div class="street-address">169 University Avenue</div>
<span class="locality">Palo Alto</span>,
<abbr class="region" title="California">CA</abbr>
<span class="postal-code">94301</span>
<div class="country-name">USA</div>
</div>
<div class="tel">
<span class="type">Work</span> +1-650-289-4040
</div>
<div class="tel">
<span class="type">Fax</span> +1-650-289-4041
</div>
<div>Email:
<span class="email">[email protected]</span>
</div>
</div>
```
|
Is Microformats vCard still a best semantic way to code "contact information", in HTML 5?
|
CC BY-SA 3.0
| 0 |
2011-04-17T06:06:51.313
|
2014-11-22T07:57:13.590
|
2017-05-23T12:07:02.087
| -1 | 84,201 |
[
"css",
"html",
"semantic-markup"
] |
5,692,247 | 1 | null | null | 0 | 8,896 |
Please view this image (focus to red around area):

|
How to draw a "Line with Markers" graph like this?
|
CC BY-SA 3.0
| null |
2011-04-17T07:36:51.457
|
2011-04-18T18:05:44.603
| null | null | 240,622 |
[
"excel",
"vba",
"graph"
] |
5,692,331 | 1 | 5,692,683 | null | 1 | 457 |
Hello Guys I am having following tables relationship with me,

and I am writing following Nested Query in my Stored Procedure
```
. Select useremail,fullname,city,[state], allowAlerts,allowLetters,aboutMe,avatar,dateregistered,
(Select COUNT(*) from blog_info where blog_info.userId = @userId)as blogCount,
(Select count(*) from blog_info where blog_info.isfeatured = 1 AND blog_info.userId = @userId)as featuredCount,
(Select COUNT(*) from blog_comments where blog_comments.userId = @userId)as commentsCount,
(Select COUNT(*) from forum where forum.createdby = @userId) as forumCount,
(Select COUNT(*) from forumresponse where forumresponse.userId = @userId)as responseCount
from user_info where _id = @userId.
```
i want to replace this nested Query with the Query that ues Joins .
Pleaes Help me to achieve this.
Thanks in Advance
|
using Joins rather than sub queries in SQL Server
|
CC BY-SA 3.0
| 0 |
2011-04-17T07:58:25.417
|
2016-01-11T13:33:59.593
| null | null | 395,661 |
[
".net",
"sql",
"sql-server-2008",
"join"
] |
5,692,428 | 1 | 5,693,448 | null | 4 | 2,866 |
I had a problem with ggplot that I am not able to solve, so maybe someone here can point out the reason. Sorry that I am not able to upload my dataset, but some data description can be found below. The output of the ggplot is shown below, except NO line, every other thing is OK.
```
> all.data<-read.table("D:/PAM/data/Rural_Recovery_Edit.csv",head=T,sep=",")
> all.data$Water<-factor(all.data$Water,labels=c("W30","W60","W90"))
> all.data$Polymer<-factor(all.data$Polymer,labels=c("PAM-0 ","PAM-10 ","PAM-40 "))
> all.data$Group<-factor(all.data$Group,labels=c("Day20","Day25","Day30"))
> dat<-data.frame(Waterconsump=all.data[,9],Water=all.data$Water,Polymer=all.data$Polymer,Age=all.data$Group)
> ggplot(dat,aes(x=Water,y=Waterconsump,colour=Polymer))+
+ stat_summary(fun.y=mean, geom="line",size=2)+
+ stat_summary(fun.ymin=min,fun.ymax=max,geom="errorbar")+#,position="dodge"
+ facet_grid(~Age)
> dim(dat)
[1] 108 4
> head(dat)
Waterconsump Water Polymer Age
1 10.5 W30 PAM-10 Day20
2 10.3 W30 PAM-10 Day20
3 10.1 W30 PAM-10 Day20
4 7.7 W30 PAM-10 Day20
5 8.6 W60 PAM-10 Day20
6 8.4 W60 PAM-10 Day20
> table(dat$Water)
W30 W60 W90
36 36 36
> table(dat$Polymer)
PAM-0 PAM-10 PAM-40
36 36 36
> table(dat$Age)
Day20 Day25 Day30
36 36 36
```

and, if I changed the geom into "bar", the output is OK.

```
below is the background for this Q
```
#
I would like to plot several variables that were subjected to the same, 3 factors. Using xyplot, I am able to plot 2 of them, within one figure. However, I have no idea how to include the third, and arrange the figure into N subplots (N equals the level number of the third factor).
So, my aims would be:
1. Plot the 3rd facotors, and split the plot into N subplots, where N is the levels of the 3rd factor.
2. Better to work as a function, as I need to plot a several variables. Below is the example figure with only two factors, and my working example to plot 2 factors.
Thanks in advance~
Marco
```
library(reshape)
library(agricolae)
library(lattice)
yr<-gl(10,3,90:99)
trt<-gl(4,75,labels=c("A","B","C","D"))
third<-gl(3,100,lables=c("T","P","Q")) ### The third factor to split the figure in to 4 subplots
dat<-cbind(runif(300),runif(300,min=1,max=10),runif(300,min=100,max=200),runif(300,min=1000,max=1500))
colnames(dat)<-paste("Item",1:4,sep="-")
fac<-factor(paste(trt,yr,sep="-"))
dataov<-aov(dat[,1]~fac)
dathsd<-sort_df(HSD.test(dataov,'fac'),'trt')
trtplt<-gl(3,10,30,labels=c("A","B","C"))
yrplt<-factor(substr(dathsd$trt,3,4))
prepanel.ci <- function(x, y, ly, uy, subscripts, ...)
{
x <- as.numeric(x)
ly <- as.numeric(ly[subscripts])
uy <- as.numeric(uy[subscripts])
list(ylim = range(y, uy, ly, finite = TRUE))
}
panel.ci <- function(x, y, ly, uy, subscripts, pch = 16, ...)
{
x <- as.numeric(x)
y <- as.numeric(y)
ly <- as.numeric(ly[subscripts])
uy <- as.numeric(uy[subscripts])
panel.arrows(x, ly, x, uy, col = "black",
length = 0.25, unit = "native",
angle = 90, code = 3)
panel.xyplot(x, y, pch = pch, ...)
}
xyplot(dathsd$means~yrplt,group=trtplt,type=list("l","p"),
ly=dathsd$means-dathsd$std.err,
uy=dathsd$means+dathsd$std.err,
prepanel = prepanel.ci,
panel = panel.superpose,
panel.groups = panel.ci
)
```
!

|
Three factor plotting using xyplot
|
CC BY-SA 3.0
| 0 |
2011-04-17T08:22:21.093
|
2011-04-18T07:06:32.770
|
2011-04-18T07:06:32.770
| 548,334 | 548,334 |
[
"r",
"plot",
"ggplot2"
] |
5,692,624 | 1 | 5,716,233 | null | 25 | 6,658 |
I want to create an artificial neural network (in PyBrain) that follows the following layout:

However, I cannot find the proper way to achieve this. The only option that I see in the documentation is the way to create fully connected layers, which is not what I want: I want some of my input nodes to be connected to the second hidden layer and not to the first one.
|
Creating custom connectivity in PyBrain neural networks
|
CC BY-SA 3.0
| 0 |
2011-04-17T09:09:29.920
|
2016-12-22T09:21:40.437
|
2011-04-17T10:10:34.260
| 17,523 | 17,523 |
[
"python",
"neural-network",
"pybrain"
] |
5,692,662 | 1 | 5,714,457 | null | 1 | 1,183 |
I've to divide a text into portions. Text contains only paragraphs ( p tags ) inside `<div id="main">`. I wanted to insert some divs with id page1...pagen, and distribute the paragraphs inside them.
Here is my code, but it is not working properly. Divs are generated before the paragraphs, and the paragraphs aren`t moved inside them.
Except the error, is there any more efficient way to do this?
```
var n = 1;
$('article').prepend('<div id="pagecnt"> </div><br/>');
$('#pagecnt').append('<a href="#'+n+'">'+n+'</a>').after('<div id="page'+n+'" style="display:block;"></div>');
var pargraph = $('p');
for (var i = 0; i < pargraph.length; i++)
{
if ( $(document).height() < 2 * $(window).height() )
{
$('#page'+n).append(pargraph[i].detach());
} else {
$('#page'+n).after('<div id="page' + ++n + '" style="display:none;"></div>');
}
}
```
EDIT : this should be the result (basically)

|
Move html elements from container to container
|
CC BY-SA 3.0
| 0 |
2011-04-17T09:17:32.397
|
2022-10-18T23:43:54.583
|
2011-04-17T10:42:09.707
| 179,669 | 179,669 |
[
"jquery",
"detach"
] |
5,692,804 | 1 | 5,692,817 | null | 86 | 46,918 |
Can we apply glowing effect to any text like shown below:

Please also tell me what things i need to create something like this:
Do i need a Special font for this?
|
How to make text glow?
|
CC BY-SA 3.0
| 0 |
2011-04-17T09:48:26.980
|
2017-05-12T07:38:35.983
|
2012-04-28T20:08:11.667
| 578,215 | 578,215 |
[
"android",
"user-interface",
"graphics",
"textview"
] |
5,692,851 | 1 | null | null | 1 | 366 |
I'm working on a GLUT based app that needs to run on Windows XP, but as I'm on a Mac, I'm doing most of the coding in Xcode, then switching over to Visual C++ 2008 every once in a while to recompile. It's been working fine, but I just realized that anti-aliasing isn't working on the Windows version.
Here are some screenshots:
Awesome on OS X

Crappy on Win XP

I'm using the GLUT display string "rgb alpha double samples depth".
The shapes aren't actual 3D, they are just triangles:
```
glBegin(GL_TRIANGLES);
{
ofSetColor(edgeColorFar1.r, edgeColorFar1.g, edgeColorFar1.b);
glVertex2f(CENTER_X, CENTER_Y);
ofSetColor(edgeColorNear1.r, edgeColorNear1.g, edgeColorNear1.b);
glVertex2f(x - _dim, y - _dim);
glVertex2f(x + _dim, y - _dim);
}
glEnd();
```
Any ideas? Thanks!
|
Anti-aliasing not working on Windows
|
CC BY-SA 3.0
| null |
2011-04-17T10:00:07.127
|
2011-07-20T11:50:41.637
| null | null | 318,077 |
[
"c++",
"windows-xp",
"glut",
"openframeworks"
] |
5,692,924 | 1 | 5,693,257 | null | 10 | 7,803 |
Im currently working on a small project in which I need to model the following scenario:
1. Customer calls, he want an quote on a new car.
2. Sales rep. register customer information.
3. Sales rep. create a quote in the system, and add a item to the quote (the car).
4. Sales rep. send the quote to the customer on email.
5. Customer accept the quote, and the quote is now not longer a quote but an order.
6. Sales rep. check the order, everything is OK and he invoice the order. The order is now not longer an order, but an invoice.
I need a bit of help finding out the ideal way to model this, but I have some thoughts.
1. I'm thinking that both draft/quote/invoice is basically an order.
2. Draft/quote/invoice need seperate unique numbers(id's) so there for i'm thinking separate tables for all of them.
This is my data model v.1.0, please let me know what you think.

I however have som concerns regarding this model:
1. Draft/quote/invoice might have different items and prices on the order lines. In this model all draft/quote/invoice is connected to the same order and also order lines, making it impossible to have separate quote lines/draft lines/invoice lines. Maybe I shall make new tables for this, but then basically the same information would be stored in multiple tables, and that is not good either.
2. Sometimes two or more quotes become an invoice, how would this model take care of this?
If you have any tips on how to model this better, please let me know!

|
Data modelling draft/quote/order/invoice
|
CC BY-SA 3.0
| 0 |
2011-04-17T10:15:13.550
|
2020-02-12T19:15:23.647
|
2011-04-20T20:45:26.037
| 219,443 | 219,443 |
[
"sql",
"database-design",
"data-modeling",
"invoice"
] |
5,693,028 | 1 | 5,697,596 | null | 0 | 854 |
I have a script that opens a huge XLSX file and reads 3000 rows of data, saving it to a two dimensional array. Of all places for Apache to crash, it does so in a simple loop that builds a MySQL query. I know this because if I remove the following lines from my application, it runs without issue:
```
$query = "INSERT INTO `map.lmds.dots` VALUES";
foreach($data as $i => $row)
{
$id = $row["Abonnementsid"];
$eier = $row["Eier"];
$status = $row["Status"];
if($i !== 0) $query .= "\n,";
$query .= "('$id', '$eier', '$status', '0', '0')";
}
echo $query;
```
I can't see a thing wrong with the code.
I'm using PHPExcel and dBug.php
---
Perhaps I should elaborate on what I mean by crash. I mean a classic Windows "Program has stopped working":

---
Another attempt inspired by one of the answers. Apache still crashes:
```
$query = "INSERT INTO `map.lmds.dots` VALUES";
$records = array();
foreach($data as $i => &$row)
{
$id = $row["Abonnementsid"];
$eier = $row["Eier"];
$status = $row["Status"];
$records[] = "('$id', '$eier', '$status', '0', '0')";
}
echo $query . implode(",", $records);
```
---
I have narrowed it down further. As soon as I add a foreach loop, Apache crashes.
```
foreach($data as $i => $row) {};
```
|
Apache crashes in a loop of string concatenation
|
CC BY-SA 3.0
| null |
2011-04-17T10:40:44.573
|
2011-04-18T01:06:14.710
|
2017-02-08T14:31:57.567
| -1 | 388,916 |
[
"php",
"apache",
"loops",
"crash",
"string-concatenation"
] |
5,693,192 | 1 | 5,699,483 | null | 49 | 30,350 |
I'm currently looking for a way to get backtrace information under Windows, from C code (no C++).
I'm building a cross-platform C library, with reference-counting memory management. It also have an integrated memory debugger that provides informations about memory mistakes ([XEOS C Foundation Library](https://github.com/macmade/XSFoundation/wiki)).
When a fault occurs, the debugger is launched, providing information about the fault, and the memory record involved.

On Linux or Mac OS X, I can look for `execinfo.h` in order to use the `backtrace` function, so I can display additional infos about the memory fault.
I'm looking for the same thing on Windows.
I've seen [How can one grab a stack trace in C?](https://stackoverflow.com/questions/105659) on Stack Overflow. I don't want to use a third-party library, so the `CaptureStackBackTrace` or `StackWalk` functions looks good.
The only problem is that I just don't get how to use them, even with the Microsoft documentation.
I'm not used to Windows programming, as I usually work on POSIX compliant systems.
What are some explanations for those functions, and maybe some examples?
I'm now considering using the `CaptureStackBackTrace` function from `DbgHelp.lib`, as is seems there's a little less overhead...
Here's what I've tried so far:
```
unsigned int i;
void * stack[ 100 ];
unsigned short frames;
SYMBOL_INFO symbol;
HANDLE process;
process = GetCurrentProcess();
SymInitialize( process, NULL, TRUE );
frames = CaptureStackBackTrace( 0, 100, stack, NULL );
for( i = 0; i < frames; i++ )
{
SymFromAddr( process, ( DWORD64 )( stack[ i ] ), 0, &symbol );
printf( "%s\n", symbol.Name );
}
```
I'm just getting junk. I guess I should use something else than `SymFromAddr`.
|
Win32 - Backtrace from C code
|
CC BY-SA 3.0
| 0 |
2011-04-17T11:19:07.083
|
2014-01-28T09:01:54.613
|
2017-05-23T10:29:39.853
| -1 | 182,676 |
[
"c",
"windows",
"backtrace"
] |
5,693,344 | 1 | 5,694,128 | null | 0 | 1,564 |
I've re-uploaded fresh copy of Prestashop v1.4.0.17 many times to my hosting, but I'm getting blank page Payment and Modules page:

It is fine in my localhost. Any idea why this happens?
|
Prestashop Blank Page Payment and Modules page
|
CC BY-SA 3.0
| null |
2011-04-17T11:50:37.443
|
2011-04-17T14:39:14.990
|
2011-04-17T14:38:22.260
| 351,564 | 351,564 |
[
"prestashop"
] |
5,693,388 | 1 | 5,693,787 | null | 2 | 3,459 |
I have a problem displaying the autosuggest box inside a jQuery dialog. The auto suggest list is displayed under the dialog no matter what. I have tried setting up the z-index property of autosuggest to > 1004. But no luck.
Below is the screenshot.

This is the CSS class I have used to style the autosuggest list:
```
ul.as-list {
position: absolute;
list-style-type: none;
margin: 2px 0 0 0;
padding: 0;
font-size: 14px;
color: #000;
font-family: "Lucida Grande", arial, sans-serif;
background-color: #fff;
background-color: rgba(255,255,255,0.95);
box-shadow: 0 2px 12px #222;
-webkit-box-shadow: 0 2px 12px #222;
-moz-box-shadow: 0 2px 12px #222;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
z-index:6000;
}
li.as-result-item, li.as-message {
margin: 0 0 0 0;
padding: 5px 12px;
background-color: transparent;
border: 1px solid #fff;
border-bottom: 1px solid #ddd;
cursor: pointer;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
z-index:6000;
}
```
I have uploaded the complete code in this [jsfiddle](http://jsfiddle.net/fTYsC/1/) page. You can see the problem there clearly. How can I fix it?
|
Z-index in jQuery dialog. Autosuggest list not displayed properly
|
CC BY-SA 4.0
| 0 |
2011-04-17T12:00:37.327
|
2018-07-28T21:01:12.783
|
2018-07-28T21:01:12.783
| 63,550 | 97,572 |
[
"javascript",
"css",
"jquery-ui",
"dialog",
"z-index"
] |
5,693,409 | 1 | null | null | 1 | 264 |
I recently installed firebug 1.7 on firefox 4 ...
When I try to enable it in the Add-ons area I can, however I don't get the icon appearing in the bottom right corner of the browser window and in the Tools drop down it appears as firebug.Firebug minus any functionality. Screen shot:

Has anyone out there had a similar problem?
|
Can't get firebug 1.7 to work in firefox 4 on a Mac
|
CC BY-SA 3.0
| null |
2011-04-17T12:06:40.083
|
2011-04-19T09:06:06.713
|
2011-04-17T12:10:17.433
| 366,904 | 712,090 |
[
"firefox",
"firebug",
"firefox4"
] |
5,693,514 | 1 | 5,693,534 | null | 7 | 5,408 |
Given max amount of iterations = 1000 give me some ideas on how to color (red, green, blue) it. All I can come up right now are lame 2 color gradients :(
Is it actually possible to come up with something as beautiful as this?

|
For all the creative people out there: coloring mandelbrot set... need ideas
|
CC BY-SA 3.0
| 0 |
2011-04-17T12:29:39.410
|
2019-06-05T07:55:05.380
|
2011-04-17T12:46:12.983
| 711,033 | 711,033 |
[
"colors",
"mandelbrot"
] |
5,693,539 | 1 | 5,702,070 | null | 0 | 2,853 |
I am trying to setup CodeIgniter on my WAMP with PHP 5.3.5 and 2.0.2 CI. My "Hello World" application run successfully (I had only a controller and view). Next I added a Model test.php
```
class Tests extends CI_Model {
function __construct() {
parent::__contruct();
}
}
```
I instantiate the model in my controller as:
```
$this->load->model('Tests');
```
But I keep getting this error:
> It is not safe to rely on the system's timezone settings.
How do I resolve this error? I tried setting date.timezone property in php.ini. I also tried calling `date_default_timezone_set` method in index.php of CI. I did go through CI forum but everybody seems to have fixed the issue by calling `date_default_timezone_set`. But when I call the method, I don't even get the error. Instead, I get an 500 server error response from Apache!
PHP & CI experts.. I need your help.
---
I enabled logging to see how things run under the mat. Here is my model:
```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Hello extends CI_Model {
function __construct()
{
log_message('debug', "Staring Hello Model");
parent::__construct();
log_message('debug', "Done with Hello Model");
}
}
```
My Controller:
```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Hello extends CI_Controller {
public function index()
{
//$this->load->view('hello');
echo phpinfo();
}
public function newfun()
{
log_message('debug', "Starting new method...");
$this->load->model('hello');
log_message('debug', "Completed model load...");
$this->load->view('hello');
}
}
```
And my log file:
```
DEBUG - 2011-04-18 15:01:44 --> Config Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Hooks Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Utf8 Class Initialized
DEBUG - 2011-04-18 15:01:44 --> UTF-8 Support Enabled
DEBUG - 2011-04-18 15:01:44 --> URI Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Router Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Output Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Security Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Input Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Global POST and COOKIE data sanitized
DEBUG - 2011-04-18 15:01:44 --> Language Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Loader Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Controller Class Initialized
DEBUG - 2011-04-18 15:01:44 --> Starting new method...
DEBUG - 2011-04-18 15:01:44 --> Model Class Initialized
```
The last log output comes from the constructor of Model.php in ci/system/core folder. There is no indication of my model's controller being executed (I don't see any log message from the model).
What's wrong with my Model? Am I coding it correctly or overlooking something silly?
|
Timezone settings problem in codeigniter
|
CC BY-SA 3.0
| null |
2011-04-17T12:36:09.013
|
2012-12-21T02:51:35.560
|
2012-12-21T02:51:35.560
| 367,456 | 185,655 |
[
"php",
"codeigniter-2"
] |
5,693,727 | 1 | 5,696,532 | null | 1 | 1,986 |
I'm using RRDtool to greate graphs.
Now, this command:
```
rrdtool graph temp.png \
-w 600 -h 200 \
--zoom 1 \
--title "last 24 hours temperature" \
--vertical-label "temperature (°C)" \
--alt-autoscale \
--alt-y-grid \
--start end-1d \
--force-rules-legend \
--legend-position=south \
--rigid \
--slope-mode \
--font "DEFAULT:12:century schoolbook l" --watermark "$(date '+%F %T %Z')" \
DEF:temperature=temp.rrd:temp:AVERAGE \
GPRINT:temperature:LAST:"Current temp.\: %.2lf°C\r" \
LINE1:temperature\#007070:"Mainboard\l"
```
Gives me this image:

As you can see, the legend and the text "Current temp.: 42.00°C", do not appear on the same height (baseline).
How can I make those kind of lines appear next to each other, one left floated, the other right floated?
|
How to make two lines appear on the same height in RRDtool?
|
CC BY-SA 3.0
| 0 |
2011-04-17T13:17:15.173
|
2011-04-17T21:21:01.977
| null | null | 414,121 |
[
"rrdtool"
] |
5,693,827 | 1 | 5,693,887 | null | 3 | 522 |
I'm thinking about creating a simplistic video game. I'm not talking about anything fancy, but about a game like this:

Since I want to learn, I would prefer not to use libraries but roll as much as I can on my own. I'd need to know how to render the car and the track, deal with collision with other cars, etc. I'm targeting Linux, Mac OS X and iOS. I fear that using a library like OpenGL makes things "too simple".
Are there any good resources out there that discuss this? Most of the tutorials / papers I have found are based around popular libraries & engines.
|
Making a simplistic video game
|
CC BY-SA 3.0
| 0 |
2011-04-17T13:37:22.463
|
2014-04-21T06:32:42.507
|
2011-04-17T15:43:20.397
| 38,368 | 282,635 |
[
"c",
"graphics"
] |
5,693,997 | 1 | 5,694,012 | null | 53 | 55,705 |

Hello, How do i create the permanent notification like the first one for Battery Indicator?
|
Android: How to create an "Ongoing" notification?
|
CC BY-SA 3.0
| 0 |
2011-04-17T14:10:13.110
|
2013-01-06T21:42:21.770
| null | null | 481,239 |
[
"android",
"notifications"
] |
5,694,201 | 1 | 5,694,868 | null | 0 | 85 |
I've made some changes to an admin form so that I could display a TextField like a CharField but the form itself looks pretty ugly in the admin menu as the form elements aren't stretching properly. I also don't want to display the name of model when I print it since it's already on the page. How would I make those changes? Ideally I would like the link field to take up all the remaining space shown the screenshot below.
`admin.py`
```
from linkrotator.models import Link, LinkList
from django.contrib import admin
from django import forms
class LinkModelForm( forms.ModelForm ):
link = forms.CharField( label = "Link")
class Meta:
model = Link
class LinkInline(admin.TabularInline):
form = LinkModelForm
model = Link
class LinkListAdmin(admin.ModelAdmin):
inlines = ( LinkInline, )
admin.site.register(LinkList, LinkListAdmin)
```
How it looks.

|
Adjusting how a ModelForm is displayed
|
CC BY-SA 3.0
| null |
2011-04-17T14:55:20.567
|
2012-08-22T10:52:52.333
|
2012-08-22T10:52:52.333
| 440,536 | 29,347 |
[
"django",
"django-models",
"django-admin"
] |
5,694,763 | 1 | 5,694,833 | null | 1 | 626 |
I want to paint a board that looks like this:

by extending :
```
import javax.swing.*;
import java.awt.Graphics;
class GoBoard extends JPanel{
private int lines;
public GoBoard(){
this.lines = 9;
}
public GoBoard(int pLines){
this.lines = pLinien;
}
public void paint(Graphics g){
super.paint(g);
int d = 0;
int h = 0;
for(int i = 0; i < this.lines+1; i++){
g.drawLine(0,h, getWidth(), h);
g.drawLine(h,0,h,getHeight());
h += getHeight()/this.lines;
}
}
}
```
For 9 lines I came up with this:

Which layout do I have to use to get the space around the board? In my example I used a box layout aligning some labels around the jpanel.
How do I have to change my paint method to get the grid you see in the first picture? It seems that I am missing the two last lines.
|
Paint a board by extending JPanel
|
CC BY-SA 3.0
| 0 |
2011-04-17T16:29:04.310
|
2013-11-05T11:53:01.210
|
2013-11-05T11:53:01.210
| 759,866 | 401,025 |
[
"java",
"jpanel"
] |
5,694,855 | 1 | null | null | 2 | 2,381 |
This method for drawing ellipses appears to be clean and elegant: [http://www.williammalone.com/briefs/how-to-draw-ellipse-html5-canvas/](http://www.williammalone.com/briefs/how-to-draw-ellipse-html5-canvas/)
However, in testing it, I found that the resulting ellipses were stretched. Setting width and height equal, I got ellipses that were about 20% taller than wide. Here's the result with `width = height = 50`:

To make sure that the problem was with the method itself, I tried changing the algorithm so that all the points used for the Bezier curves were rotated 90 degrees. The result:

Again, in both cases, I was expecting a 50x50 circle. Using the `arc` method described at [How to draw an oval in html5 canvas?](https://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas) works fine, generating perfect 50x50 circles (which can then be stretched into ellipses using `scale`).
What's going on?
|
Bezier curves draw stretched ellipses in HTML5 canvas
|
CC BY-SA 3.0
| null |
2011-04-17T16:45:18.783
|
2011-04-17T16:45:31.093
|
2017-05-23T12:34:54.237
| -1 | 66,226 |
[
"javascript",
"html",
"canvas",
"bezier",
"ellipse"
] |
5,695,003 | 1 | 5,695,012 | null | 1 | 600 |
I have a User interface in VB.net(for a desktop application). And i want the backend to be in Java.
How to connect them .

Example: I want to have the search box functionality to be wriiten in Java.
|
Can VB.net UI(Front end) be joined with Java Backend
|
CC BY-SA 3.0
| null |
2011-04-17T17:09:21.060
|
2011-11-30T12:05:51.173
| null | null | 651,362 |
[
"java",
"vb.net"
] |
5,695,120 | 1 | 5,705,851 | null | 5 | 2,467 |
I've looked for quite some time now to find a nice math solution for my cannon firing a projectile at a moving target, taking into account the gravity. I've found a solution for determining the angle at which the cannon should be fired, based on the cannon's position, the target's position and the start velocity. The formula is described here: [http://en.wikipedia.org/wiki/Trajectory_of_a_projectile#Angle_.CE.B8_required_to_hit_coordinate_.28x.2Cy.29](http://en.wikipedia.org/wiki/Trajectory_of_a_projectile#Angle_.CE.B8_required_to_hit_coordinate_.28x.2Cy.29).

This works perfectly. However, my target is moving, so if I shoot at the target and the projectile takes a few seconds to get to its destination, the target is long gone. The target's x position can be determined from the time. Lets say that: where t is the time in seconds. The y can be described as: .
The problem is, that t depends on the angle at which the cannon is fired.
Therefor my question is: How can I modify the formula as described in the wiki, so that it takes the moving target into account?
Additionally, I might have been looking at the wrong words here or on Google, but I didn't find any solution describing this exact problem.
Thank you in advance for your braintime!
As a reply to your comments. I want to fire it now and the target is in range given the speed. I think that are all constraints that are applicable to this problem.
As a reply to the answer, lets take a look at this example:
The cannon is at {0, 0} and isn't moving.
The start speed is 100 m/s.
The target is at {1000, 0} and is moving with 10 m/s towards the cannon (v = -10 m/s).
What angle should I use to hit the moving target, when I want to fire at t=0 (immediately)?
If I shoot without taking the target's speed into account, I would aim at {1000, 0} and the angle could be calculated using the mentioned formula. But it will miserably miss the target because its moving.
As Beta suggested, I could aim at i.e. {500, 0}, calculate what time it takes for the projectile to arrive at those coords (lets say 5 seconds) and wait until the target is 5 seconds away from {500, 0}, being {550, 0}. But this means that I have to wait 450m or 45 seconds before I can fire my cannon. And I don't want to wait, because the target is killing me in the mean time.
I really hope this gives you enough info to go with. I'd prefer some math solution, but anything that would get me really close to firing "right away" and "right on target" is also much appreciated.
|
Trajectory of a projectile meets a moving object (2D)
|
CC BY-SA 3.0
| 0 |
2011-04-17T17:29:49.743
|
2011-04-18T16:19:19.530
|
2011-04-17T20:22:18.217
| 477,824 | 477,824 |
[
"math",
"2d"
] |
5,695,164 | 1 | null | null | 6 | 5,043 |
I'm having a weird problem with my google maps marker icons in internet explorer. All my markers are showing up cut in half doubled and shifted over 50 %.

that is using the demo code from google. So it must be something weird i'm doing elsewhere with styles or jquery, but i don't know what. Has anyone had this problem before?
|
Google Maps marker cut in half internet explorer
|
CC BY-SA 3.0
| 0 |
2011-04-17T17:37:09.697
|
2015-02-20T16:49:02.577
|
2011-12-04T00:14:27.900
| 84,042 | 458,323 |
[
"google-maps",
"internet-explorer-8",
"internet-explorer-7",
"google-maps-markers"
] |
5,695,273 | 1 | 5,695,468 | null | 1 | 300 |
In WPF and xaml i want to have a combo box with items like list0 - list5
Now, when i select that item or index i want it to display in a list box.
I want it to populate the list box with those words below and the correct index like if i select the first one "List0" it displays in the list box:
```
foo0
bar0
baz0
toto0
tintin0
```
So, when i select "list3" in the combobox
It will display those words with the right index thats selected... can this be done with xaml?
If this cant be done in xaml can i do this in C# with xaml project?
here is a pic of what i want to accomplish!

|
combox select item display in a list box
|
CC BY-SA 3.0
| null |
2011-04-17T17:53:09.887
|
2011-04-17T18:29:53.827
| null | null | null |
[
"wpf",
"xaml",
"binding"
] |
5,695,289 | 1 | 5,695,310 | null | 0 | 62 |
Why can't i pull this field `pID` from the the database?
I have the following php:
```
<?php
// Get course information cID, prefix, code and dept info : name
$cID = filter_input(INPUT_GET, 'cID', FILTER_SANITIZE_NUMBER_INT);
if(!$cID) {
echo "No cID specified.";
exit;
}
require_once('inc/dbc1.php');
$pdo4 = new PDO('mysql:host=localhost;dbname=###', $username, $password);
$pdo4->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sth4 = $pdo4->prepare('
SELECT fname, lname
FROM Course Cou, Comment Comm, Professor P
WHERE Cou.cID = ?
AND P.pID = Comm.pID
GROUP BY concat(fname, lname);
');
$sth4->execute(array(
$cID
));
?>
```
```
<a href='prof.php?pID={$row['pID']}' title='Drexel Professor Comments for {$row['fname']} {$row['lname']}'>
```

The above is pulling the fname and lname fields, but the first call for pID is not being pulled.
- If I add pID to the select statement,
it gives me the ambiguous pID error.
Anyone??
|
Why can I not pull this field? Php / Mysql
|
CC BY-SA 3.0
| null |
2011-04-17T17:54:34.183
|
2011-04-17T17:57:44.510
| null | null | 700,070 |
[
"php",
"mysql"
] |
5,695,394 | 1 | 5,695,895 | null | 1 | 2,096 |
I have two nibs:
1. Store.nib
2. Product.nib
Product.nib's File owner is a subclass of `NSViewController` which has a property `product` to which various controls are bound:
```
@property(nonatomic, retain) SRProduct *product;
```

---
Store.nib has an `NSArrayController` object which has been bound to a property of `SRApplicationController`, which is this property:
```
@property(nonatomic, retain) NSArray *products;
```
`SRApplicationController` has an outlet to that `NSArrayController` object.

---
In the `-[SRApplicationController init]` method I init an `SRProductController` object with the Product.nib nib. In `-[SRApplicationController awakeFromNib]` I add the view of the product controller to a view in Store.nib, and I bind the `productsArrayController` property (the outlet) of the `SRApplicationController` object to the `product` of the product controller:
```
- (id)init {
if (self = [super init]) {
self.productController = [[SRProductController alloc] initWithNibName:@"Product" bundle:nil];
}
return self;
}
- (void)awakeFromNib {
[self.productView removeAllSubviews]; // this method is from a category
[self.productView addSubview:self.productController.view];
[self.productController.view setFrame:self.productView.bounds];
[self.productsArrayController bind:@"selectedObjects" toObject:self.productController withKeyPath:@"product" options:nil];
}
```
---
When I run the app, I get no errors, no warnings, the console remains empty, the table view with all products in Store.nib shows all products and I can select them. The problem is that all fields in Product.nib are empty, but they bound to the `product` property of the file owner. Can anyone help me with this problem? Thanks in advance. :)
|
Binding with the selection of an NSArrayController in another nib
|
CC BY-SA 3.0
| 0 |
2011-04-17T18:09:28.837
|
2012-08-22T08:19:16.713
| null | null | null |
[
"objective-c",
"cocoa",
"model-view-controller",
"cocoa-bindings"
] |
5,695,393 | 1 | 5,695,513 | null | 3 | 2,509 |
: In response to Robus' answer I tried to run the PHP script from command line. This is the result:

But interestingly; an echo statement that was located the `foreach` loop in my code output it's text to the console window. Thus I can only assume that CLI crashes at the conclusion of / after running the script.
---
I have a script which function is to load all rows from an XLSX file into a MySQL table. I am using PHPExcel for this. I wrote the function `loadFromXLS` to load the data from the XLSX file and return a two dimensional array with the data. In this particular case that means 3100 rows and 29 columns.
This is the function:
```
function loadFromXLS($filepath)
{
$retval = array();
$cols = array();
$rownum = 0;
$reader = PHPExcel_IOFactory::createReaderForFile($filepath);
$reader->setReadDataOnly(true);
$phpObject = $reader->load($filepath);
$sheet = $phpObject->getActiveSheet();
foreach($sheet->getRowIterator() as $row)
{
$celliterator = $row->getCellIterator();
$celliterator->setIterateOnlyExistingCells(false);
$cellnum = 0;
foreach($celliterator as $cell)
{
if($rownum === 0)
{
$cols[$cellnum] = $cell->getValue();
}
else
{
if(is_array($retval[$rownum-1]))
$retval[$rownum-1] += array($cols[$cellnum] => $cell->getValue());
else
$retval[$rownum-1] = array($cols[$cellnum] => $cell->getValue());
}
$cellnum++;
}
$rownum++;
}
unset($reader, $phpObject, $sheet);
return $retval;
}
```
The top row of the file is the column names.
In any case, I have confirmed that it loads the data correctly by `var_dump`ing the first few rows and checking the array length.
This is the problem. As soon as I add this line:
```
foreach($data as $i => $row) {};
```
Apache simply crashes when it gets to that point:

---
`memory_limit`
[phpinfo() screenshot](http://i76.photobucket.com/albums/j37/dahwan/Capture-6.png)
|
Apache crashes in a large foreach loop on an associative array in PHP
|
CC BY-SA 3.0
| 0 |
2011-04-17T18:09:26.123
|
2011-04-17T21:06:09.063
|
2017-02-08T14:31:58.247
| -1 | 388,916 |
[
"php",
"crash",
"foreach",
"associative-array",
"phpexcel"
] |
5,695,835 | 1 | 5,696,147 | null | 10 | 21,685 |
This refactoring function in Eclipse for package names used to work for me fine until... today:
This is the first time I am receiving this weird Refactoring error, and I have no idea what to make of it:
> An exception has been caught while
processing the refactoring 'Rename
Package'.Reason: Problems encountered while
moving resources.Click 'Undo' to undo all successfully
executed changes of the current
refactoring. Click 'Abort' to abort
the current refactoring.
What could possibly explain this sudden "change of heart" and how do I fix it?

|
exception has been caught while processing the refactoring 'Rename package'
|
CC BY-SA 3.0
| 0 |
2011-04-17T19:20:36.600
|
2022-07-02T11:56:35.840
|
2012-08-15T20:06:06.263
| 1,049,915 | 418,055 |
[
"java",
"eclipse",
"refactoring"
] |
5,695,915 | 1 | 5,697,073 | null | 1 | 2,154 |
I am not able to connect my PC to Android device using adb. I have enabled USB debugging option on the device.
The `adb devices` options shows following output

Device Manager output is shown below

What could be going wrong? Any suggestions?
|
Unable to connect Huawei u8110 via ADB
|
CC BY-SA 3.0
| null |
2011-04-17T19:33:13.110
|
2012-07-15T08:35:01.780
|
2012-07-15T08:35:01.780
| 777,408 | 268,501 |
[
"android",
"adb"
] |
5,695,959 | 1 | 5,697,039 | null | 4 | 1,140 |
Quick one folks. Have a quick look at the code snippet below. I alloc the but I don't release it (commented out). When the method ends, I lose reference to the pointer so it leaks.
Thing is that XCode Instruments doesn't find this leak and I would have thought that it is quite a straightforward case for it to find it. Its not reporting any leaks in my application and yet I found this one myself and its made me a little suspicious.
Am I over looking something or is Instruments rather poor at detecting leaks?
```
-(UITableViewCell*)newReadOnlyCellWithTitle:(NSString*)title andText:(NSString*)text {
UITableViewCell *cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
cell.textLabel.text=title;
cell.selectionStyle=UITableViewCellSelectionStyleNone;
cell.backgroundColor=[UIColor whiteColor];
cell.opaque=YES;
UILabel *textLabel=[[UILabel alloc] initWithFrame:CGRectMake(80, 11, 350, 24)];
textLabel.text=text;
textLabel.textColor=[UIColor lightTextColor];
textLabel.font=[UIFont fontWithName:STANDARD_FONT size:16.0];
textLabel.opaque=YES;
textLabel.backgroundColor=[UIColor clearColor];
[cell.contentView addSubview:textLabel];
//[textLabel release]; //<== without the release this should leak, yep?
return cell;
}
```
output from static analyizer...

|
Why does instruments not find this leak?
|
CC BY-SA 3.0
| 0 |
2011-04-17T19:42:00.383
|
2011-04-17T23:01:36.600
|
2011-04-17T23:01:36.600
| 667,301 | 690,970 |
[
"objective-c",
"xcode",
"memory-management",
"static-analysis",
"instruments"
] |
5,696,020 | 1 | 5,697,035 | null | 2 | 288 |
The design of the UITableView is something like this:

I want to make my cells with a tiny triangle, like in a comic book. The thing is, how can i add the triangle to the size of my custom cell? The common rectangle size wouldn't work if i want the user to be able to tap that little rectangle.
And how can i make the opposite? I want the triangle to cover the space of another cell, so tapping the little triangle of the first cell, covering part of the second cell's rectangle space, would activate de first one. This is, substracting a little triangle from the cell's space.
|
Covering space from one UITableView's cell with another one
|
CC BY-SA 3.0
| 0 |
2011-04-17T19:52:08.680
|
2011-04-17T23:01:23.917
| null | null | 495,904 |
[
"iphone",
"objective-c",
"uitableview"
] |
5,696,421 | 1 | 5,702,881 | null | 1 | 555 |
I am removing events from a MIDI Track and I assumed that by doing so the total duration of the Track would reduce accordingly, If there are no events in the Track then I thought that the size of the Track would be 0.
Unfortunately it seems it is not the case, even though the events are removed the size in Ticks does not change and only increases as more are added.
Is this normal MIDI/Java behaviour?
This is the method that removes all of the events from the Track:
```
public static boolean Remove() {
//TODO: Test the bejeezus out of it.
if(_sequencer.isRunning()){
_sequencer.stop();
}
for (int i = 0; i < _track.size(); i++) {
if (!_track.remove(_track.get(i))) {
Logger.Add("MIDI Event not removed");
return false;
}
}
//Used for debugging purposes
long z = _track.ticks();
}
```
Yet when I use some crude debugging techniques and check the amount of ticks directly after removing the events, I find this;

It seemingly makes no difference, I don't really understand why it's doing it. I assumed that the size of Ticks depends on the amount of events in the Track, therefore if there were 10 events in a track the tick size would be 10 (As I set the tick length to 1 when adding them to the track) likewise if there were no events the size would be 0.
```
public static void AddMessage(int channel, int pitch, long tick, int velocity) {
_track.add(CreateNoteOnEvent(channel, pitch, tick, velocity));
_track.add(CreateNoteOffEvent(channel, pitch tick, velocity));
}
```
|
Track behaviour - Java MIDI
|
CC BY-SA 3.0
| null |
2011-04-17T21:01:41.100
|
2017-11-02T15:49:12.323
|
2017-11-02T15:49:12.323
| 7,943,564 | 218,159 |
[
"java",
"midi"
] |
5,696,959 | 1 | 5,711,927 | null | 6 | 13,804 |
I have a function that sets Emacs' color theme to a theme defined by myself. In this function I do:
```
(set-face-attribute 'default cur-frame :foreground fg-color :background bg-color)
```
I then set the background color, foreground color, and cursor color for `default-frame-alist`, `initial-frame-alist` and `special-display-frame-alist`.
All of this works fine on my Mac. But when I use this on Linux, it looks fine for all frames that have already been opened, but on newly created frames it looks like this:

I do not have this problem with new frames if use the `set-background-color` / `set-foreground-color` functions instead of (`set-face-attribute 'default ...`). But if I do that I have to manually reset the colors for every frame that's already open.
I am using Emacs version 23.3 on both Mac and Ubuntu.
For clarification, this is the theme file I use:
[my-color.el](https://bitbucket.org/brownstone/emacs_configuration/src/83edfb4bc0fb/my-color.el)
|
Change Emacs' background color
|
CC BY-SA 3.0
| 0 |
2011-04-17T22:40:36.650
|
2015-07-08T09:44:26.857
|
2014-04-04T07:48:19.207
| 1,199,226 | 649,157 |
[
"emacs",
"customization",
"emacs-faces"
] |
5,697,211 | 1 | 5,697,402 | null | 13 | 10,179 |
If so, what is the appropriate way to specify an x64 build?
In my .wxs file, I have something like this:
```
<Package Description ="$(var.pkgDescription)"
Comments ='Produced: Sun 17 April 2011'
Manufacturer ="Mfr name here"
InstallerVersion ='200'
Platform ='$(var.Platform)'
Compressed ='yes' />
```
...where I use `-dPlatform=x64` on the candle.exe command line. This seems to work.
But, in the WIX3 documentation, it states that both the `Platform` attribute and the `Platforms` attribute are deprecated. It does not describe what replaces them, or what developers should use in place of these.

When I remove the Platform attribute from the above element, and run the build, I get an ICE80 error:
> Product.wxs(285) : error LGHT0204 : ICE80: This package contains 64 bit component 'C.Textfiles' but the Template Summary Property does not contain Intel64 or x64.
It builds successfully if I use the `Platform` attribute, but because of the documentation, I am unsure if this is correct.
What is the proper way to build an x64 MSI??
|
WIX: is the Platform attribute of the Package element truly deprecated?
|
CC BY-SA 3.0
| null |
2011-04-17T23:34:59.977
|
2011-04-18T02:43:49.293
| null | null | 48,082 |
[
"wix",
"windows-installer"
] |
5,697,256 | 1 | 5,697,409 | null | 3 | 6,515 |
I have a gap between the content of my website and the bottom of the window that I've been trying to remove for a few days and have not found a solution to. Please see [http://bpc.paulsham.com](http://bpc.paulsham.com) or the image below.

From what I've tried, the `<body>` has no margin or padding, the `<div id="page-wrapper">` has no bottom margin, and no divs nested in the footer have any bottom margins that should affect it. Using Firebug, it seems like the actual `<html>` is pulled up from where the window.
This is a custom theme based on the Bartik default theme of Drupal 7, but I think this is a CSS issue. I am, however, beginning to wonder if this is a doctype issue, but everything seems to be validating fine.
Thank you for your help and please let me know if this requires more information.
|
Gap at bottom of website
|
CC BY-SA 3.0
| 0 |
2011-04-17T23:44:07.380
|
2021-10-21T08:35:32.910
|
2011-04-17T23:49:19.733
| 664,898 | 664,898 |
[
"css",
"drupal",
"drupal-7"
] |
5,697,281 | 1 | 5,697,418 | null | 2 | 2,008 |
1] Javascript
2] Jquery (elements currently being used are Jquery tab and Jquery datatable)
3] Python
4] Google App engine
1] I have a javascript function that calls a python class and gives it users city and country value.
2] The python class then queries the database and finds out the particular city entry in the database and returns the object back to javascript.
3] I have a alert box in javascript and can see the object being printed successfully. I am using jquery tabs and within the tab I have a datatable.

4] I want the data obtained in the javascript to be usable inside the jquery tab so that the data can be printed in the datatable format
1] Javascript code that calls the python class , giving it users country and city
```
<!-- script snippet to fill in users country and city value by making a calls to the geoip library -->
<script type="text/javascript">
// selecting users country and users city,
// the id for users country drop-down list is "id_country_name"
// the id for users city text-box is id_city_name
$(function () {
//finding the users country and city based on their IP.
var $users_country = geoip_country_name()
var $users_city = geoip_city()
// setting the drop-down list of country and text-box of the city to users country and city resp
$("#id_country_name").val($users_country);
$("#id_city_name").val($users_city);
//since we have users country and city, calling python class to get the data regarding users country and city combination
$.post("/AjaxRequest", {
selected_country_name: $users_country,
selected_city_name: $users_city
},
function(data) {
alert(data);
}
);
});
</script>
```
2] HTML code for jquery tabs and jquery datatable.
```
<div id="userReportedData">
<!-- Setting up the tabs to be shown in the html page, not the name of the tabs div is "tabs"
this matches with the name defined the javascript setup for jquery tabs -->
<div id="tabs">
<!-- defining the tabs to be shown on the page -->
<ul>
<li><a href="#your_city">Your City</a></li>
</ul>
<div id="your_city">
<!-- Table containing the data to be printed-->
<table cellpadding="0" cellspacing="0" border="0" class="display" id="datatable_for_current_users">
<thead>
<tr>
<th>Country</th>
<th>City</th>
<th>Reported at</th>
</tr>
</thead>
<tbody>
{%for status in data_for_users_city.statuses %}
<tr class="gradeA">
<td>{{data_for_users_city.country.country_name}}</td>
<td>{{data_for_users_city.city_name}}</td>
<td>{{status.date_time }}</td>
</tr>
{%endfor%}
</tbody>
</table>
</div>
```
I want the data that is obtained by the javascript function from the python class to be accessible inside the tbody to be used.
NOTE: the for loop in the tbody isn't working, once i have the data for the "data_for_users_city" correctly loaded , then i will test this.
3] Python class which is sending the data to javascript:
```
class AjaxRequest(webapp.RequestHandler):
#the string content of the template value 'all_data_from_datatabse'
__TEMPLATE_ALL_DATA_FROM_DATABASE_FOR_USERS_CITY = 'data_for_users_city'
def post(self):
user_reported_country_get = self.sanitize_key_name( self.request.get("selected_country_name") )
user_reported_city_get = self.sanitize_key_name( self.request.get("selected_city_name") )
data_for_users_country_city = self.get_data_for_users_country_and_city(user_reported_country_get, user_reported_city_get)
template_values = {
self.__TEMPLATE_ALL_DATA_FROM_DATABASE_FOR_USERS_CITY: data_for_users_country_city
}
self.response.out.write(data_for_users_country_city)
def sanitize_key_name(self,key_name):
string_key_name = unicodedata.normalize('NFKD', key_name).encode('ascii','ignore')
return re.sub(r'\s', '', string_key_name.lower())
def get_data_for_users_country_and_city(self,users_country,users_city):
key_name_for_user_reported_city = users_country + ":" + users_city
return UserReportedCity.get_by_key_name( key_name_for_user_reported_city )
```
[EDIT#1]
javascript solution that worked
```
function LoadUsersDatatable(data) {
var tbody = $("#datatable_for_current_users > tbody").html("");
jsonData = jQuery.parseJSON(data);
for (var i = 0; i < jsonData.length; i++)
{
var citydata = jsonData[i];
var rowText = "<tr class='gradeA'><td>" + citydata.city.country.country_name + "</td><td>" + citydata.city.city_name + "</td><td>" + citydata.status + "</td><td>" + citydata.date_time.ctime + "</td></tr>";
$(rowText).appendTo(tbody);
}
}
```
|
Want data returned by python to javascript to be accessible inside a html div
|
CC BY-SA 3.0
| 0 |
2011-04-17T23:51:19.330
|
2011-04-21T01:32:57.990
|
2011-04-21T01:32:57.990
| 639,582 | 639,582 |
[
"javascript",
"python",
"ajax",
"google-app-engine"
] |
5,697,429 | 1 | 5,697,920 | null | 3 | 946 |
I have an app that has returned an error report. The app is written in Delphi 2006 and hangs during startup. The MadExcept main thread stack is shown below. I suspect there is no default printer but I can't replicate the fault here.

Anyone seen this problem?
Initialization part of unit WWPrintToPrinterOrPDFRoutines
```
initialization
PagesRangeStartPage := 1 ;
PagesRangeEndPage := 999 ;
PrintRange := prAll ;
PrintCopies := 1 ;
PrintCollate := false ;
InitialPrintPaperName := 'A4' ;
if (Printer.Printers.Count = 0) then // <--------- this causes the hang
begin
InitialPrintOrientation := Printers.poPortrait ;
end
else
begin
InitialPrintOrientation := GetDefaultPrinterOrientation ;
InitialPrintPaperName := GetDefaultPrinterPaperName ;
end ;
CurrentPreviewPage := 1 ;
NDRMemoryStream := TMemoryStream.Create ;
```
or disassembled:
```
WWPrintToPrinterOrPDFRoutines.pas.682: PagesRangeStartPage := 1 ;
007C4404 C705EC8B81000100 mov [$00818bec],$00000001
WWPrintToPrinterOrPDFRoutines.pas.683: PagesRangeEndPage := 999 ;
007C440E C705F08B8100E703 mov [$00818bf0],$000003e7
WWPrintToPrinterOrPDFRoutines.pas.684: PrintRange := prAll ;
007C4418 C605F48B810001 mov byte ptr [$00818bf4],$01
WWPrintToPrinterOrPDFRoutines.pas.685: PrintCopies := 1 ;
007C441F C705F88B81000100 mov [$00818bf8],$00000001
WWPrintToPrinterOrPDFRoutines.pas.686: PrintCollate := false ;
007C4429 C605FC8B810000 mov byte ptr [$00818bfc],$00
WWPrintToPrinterOrPDFRoutines.pas.687: InitialPrintPaperName := 'A4' ;
007C4430 B8288C8100 mov eax,$00818c28
007C4435 BAC0447C00 mov edx,$007c44c0
007C443A E82D1AC4FF call @LStrAsg
WWPrintToPrinterOrPDFRoutines.pas.689: if (Printer.Printers.Count = 0) then
007C443F E8B0BCCDFF call Printer
007C4444 E89FB7CDFF call TPrinter.GetPrinters <----- HANG OCCURS HERE
```
|
Delphi TPrinters.GetPrinters call hangs
|
CC BY-SA 3.0
| null |
2011-04-18T00:25:45.583
|
2011-04-18T02:19:43.087
|
2011-04-18T01:18:45.167
| 89,691 | 89,691 |
[
"delphi",
"startup",
"freeze",
"delphi-2006",
"printers"
] |
5,697,850 | 1 | 5,697,988 | null | 5 | 10,035 |
I would like to change the autocomplete dropdown boxes element size to something smaller.
Any change i do with textview.settextsize affects only the value in the fieldbox and not in the drop down box!

I am adding the list items dynamically and my adapter is set to the resource
```
adapterForFromAutoText.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
```
Should i add my own resource to customize the style of the font, if so does it matter that i use `adapterForFromAutoText.add(displayName);` to dynamically add data through the adapter.
|
Android autocompletetextview dropdown box's elements have a large font
|
CC BY-SA 3.0
| 0 |
2011-04-18T02:00:50.280
|
2016-09-19T13:11:05.523
| null | null | 287,280 |
[
"android",
"autocompletetextview"
] |
5,697,979 | 1 | 5,784,075 | null | 4 | 1,945 |
I really hope someone will be able to help me out with this.
I am trying to create a data mapping model (for an iOs app) in Xcode for the first time.
This should be a very simple migration (although not covered by lightweight migration); here is what I originally had and what the new database looks like:

What changed:
- `DBdisplayOrder`- `DBreminder``DBreminderDate`
So basically I only need to copy data from one attribute, which now resides in a new entity.
I would be very grateful if someone could point me in the right direction, or just recommend a good resource to study from and get started.
|
CoreData migration & data mapping: creating a new entity from existing attribute
|
CC BY-SA 3.0
| 0 |
2011-04-18T02:32:19.130
|
2017-09-15T00:12:29.533
|
2011-04-18T11:48:20.340
| 560,496 | 560,496 |
[
"database",
"cocoa",
"core-data"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.