qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
2,593,644 | UserA and UserB are changing objectA.filedA objectA.filedB respectively and at the same time.
Because they are not changing the same field one might think that there are no overlaps.
Is that true?
or the implementation of pm.makePersistnace() actually override the whole object...
good to know... | 2010/04/07 | [
"https://Stackoverflow.com/questions/2593644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306393/"
] | Is this what you're envisioning happening?
1. Alice retrieves the object. { a = 1, b = "Foo" }
2. Bob retrieves the object. { a = 1, b = "Foo" }
3. Alice modifies the object, by changing b. { a = 1, b = "Bar" }
4. Bob modifies the object, by changing a. { a = 2, b = "Foo" }
5. Alice persists her copy of the object. { ... | Thanks for your answer.
Pity that the makePersistence() implementation is to write the WHOLE object to the datastore and not only to the fields that were changed.
This fact is actually forcing ANY shared object update in GAE to use a transaction as a rule.
Further more - in such cases you must implement the "retry me... |
73,688,701 | I am trying to understand fluent builder patterns and in my case, I have an object that has child objects too. Most of the online examples are based on a single object. There are some examples for nested objects but they all are different. So I am here to find out what is the correct way to implement a fluent builder p... | 2022/09/12 | [
"https://Stackoverflow.com/questions/73688701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5933521/"
] | What I usually do in this cases is to use nested builders with lambdas, which are useful when the nested classes have many parameters needed at construction time:
```
public class Controller
{
private readonly Robot _robot;
private readonly Table _table;
public Controller(Robot robot, Table table)
{
... | Fluent pattern works as class returns the type of class. So we can return `this`.
Let me show an example. `ControllerBuilder` would look like this:
```
public class ControllerBuilder
{
Controller _controller = new();
public ControllerBuilder WithRobot(Point point)
{
return this;
}
publ... |
73,688,701 | I am trying to understand fluent builder patterns and in my case, I have an object that has child objects too. Most of the online examples are based on a single object. There are some examples for nested objects but they all are different. So I am here to find out what is the correct way to implement a fluent builder p... | 2022/09/12 | [
"https://Stackoverflow.com/questions/73688701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5933521/"
] | Fluent pattern works as class returns the type of class. So we can return `this`.
Let me show an example. `ControllerBuilder` would look like this:
```
public class ControllerBuilder
{
Controller _controller = new();
public ControllerBuilder WithRobot(Point point)
{
return this;
}
publ... | To ease the maintenance of a fluent API I created a tool, Java::Geci.
Using this tool you create a simple class with methods that set the values and the tool will generate a wrapper class for chaining and all the interfaces that restrict the order of the methods you can apply one after the other.
You can define your ... |
73,688,701 | I am trying to understand fluent builder patterns and in my case, I have an object that has child objects too. Most of the online examples are based on a single object. There are some examples for nested objects but they all are different. So I am here to find out what is the correct way to implement a fluent builder p... | 2022/09/12 | [
"https://Stackoverflow.com/questions/73688701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5933521/"
] | What I usually do in this cases is to use nested builders with lambdas, which are useful when the nested classes have many parameters needed at construction time:
```
public class Controller
{
private readonly Robot _robot;
private readonly Table _table;
public Controller(Robot robot, Table table)
{
... | To ease the maintenance of a fluent API I created a tool, Java::Geci.
Using this tool you create a simple class with methods that set the values and the tool will generate a wrapper class for chaining and all the interfaces that restrict the order of the methods you can apply one after the other.
You can define your ... |
1,644,630 | As probably with most of the world, my cable modem experiences downtime intermittently each day (for maybe several minutes).
The problem is, I use my cable modem for DHCP - I have a switch connected to one of it's LAN outputs and have a number of computers connected to the switch. Everything is wired, no wireless.
Wh... | 2021/04/26 | [
"https://superuser.com/questions/1644630",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | [DiskWarrior](https://www.alsoft.com) is quite probably the only tool that could fix the drive non-destructively. Everything else is going to just be to scavenge what it can find of your data, not fix the drive. [Testdisk](https://www.cgsecurity.org/wiki/TestDisk) is probably the only free tool worth looking at. | Another tool that is available is [**Disk Drill**](https://www.cleverfiles.com/pro.html), it has tree editions
 |
1,644,630 | As probably with most of the world, my cable modem experiences downtime intermittently each day (for maybe several minutes).
The problem is, I use my cable modem for DHCP - I have a switch connected to one of it's LAN outputs and have a number of computers connected to the switch. Everything is wired, no wireless.
Wh... | 2021/04/26 | [
"https://superuser.com/questions/1644630",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | If the disk is not mounting, then you will likely have to spend some money on
a repair utility or a data recovery application, if the data is important and
has no backup.
Although you have specified that you are not interested
in commercial software, I list below some such tools, if no better answer
comes up. You may ... | Another tool that is available is [**Disk Drill**](https://www.cleverfiles.com/pro.html), it has tree editions
 |
4,996,510 | I am still having problems with the code not stopping the video from rewinding to the beginning. The code that John posted doesn't seem to be working for me.
He said:
>
> I believe that the default behavior of the element is to go back to the beginning so you'd just need to override this by listening for the ended e... | 2011/02/14 | [
"https://Stackoverflow.com/questions/4996510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612137/"
] | This worked for me, you need to call the methods on the DOM object not the jQuery object.
```
var player = $('video');
player[0].addEventListener('ended', function(e) {
player[0].setCurrentTime(player[0].duration);
}, false);
``` | should be
```
player[0].player.media
``` |
4,996,510 | I am still having problems with the code not stopping the video from rewinding to the beginning. The code that John posted doesn't seem to be working for me.
He said:
>
> I believe that the default behavior of the element is to go back to the beginning so you'd just need to override this by listening for the ended e... | 2011/02/14 | [
"https://Stackoverflow.com/questions/4996510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612137/"
] | I wrote a fix for this problem and John merged in version 2.10.2.
There is now an option "autoRewind" that you can set to false to prevent the player from going back to the beginning.
The eventlistener is not added and there is no more need to remove it.
```
$('video').mediaelementplayer({
autoRewind: false
});
`... | should be
```
player[0].player.media
``` |
4,996,510 | I am still having problems with the code not stopping the video from rewinding to the beginning. The code that John posted doesn't seem to be working for me.
He said:
>
> I believe that the default behavior of the element is to go back to the beginning so you'd just need to override this by listening for the ended e... | 2011/02/14 | [
"https://Stackoverflow.com/questions/4996510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612137/"
] | This worked for me, you need to call the methods on the DOM object not the jQuery object.
```
var player = $('video');
player[0].addEventListener('ended', function(e) {
player[0].setCurrentTime(player[0].duration);
}, false);
``` | I think the best solution is to edit 'mediaelement-and-player.min.js' (if you are using that)... do a text search for c.media.setCurrentTime(0) and comment it out or delete it. |
4,996,510 | I am still having problems with the code not stopping the video from rewinding to the beginning. The code that John posted doesn't seem to be working for me.
He said:
>
> I believe that the default behavior of the element is to go back to the beginning so you'd just need to override this by listening for the ended e... | 2011/02/14 | [
"https://Stackoverflow.com/questions/4996510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612137/"
] | I wrote a fix for this problem and John merged in version 2.10.2.
There is now an option "autoRewind" that you can set to false to prevent the player from going back to the beginning.
The eventlistener is not added and there is no more need to remove it.
```
$('video').mediaelementplayer({
autoRewind: false
});
`... | I think the best solution is to edit 'mediaelement-and-player.min.js' (if you are using that)... do a text search for c.media.setCurrentTime(0) and comment it out or delete it. |
36,909,848 | I want to catch word with non-space.
```
var paragraphy="Apple banana kişiler ki örnek foo.";
var word="kişiler";
var regex = new RegExp("(?:[\\s>]|^)("+word+")(?=[.,;?!]?(?:[<\\s])|$)", "gi");
console.log(paragraphy.match);
```
This prints: [" kişiler"] but I want this result: ["kişiler"]
I must use Positive Lookb... | 2016/04/28 | [
"https://Stackoverflow.com/questions/36909848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6235706/"
] | Because you need to load your scrollto script at the end of the body tag, to make sure DOM is loaded. Otherwise you can wrap your code in
```
$(document).ready(function(){
//your code here
});
```
or use the sort version
```
$(function() {
//your code here
});
``` | You can try this:
```
$('body').on('click', 'a[href^="#"]', function (event) {
var target = $(this.href);
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 10000);
}
});
```
You can replace body with any parent selector which are loade... |
42,224,289 | I have a login page that is built in a file called LoginViewController.swift
After the user logs in, I want to send them to a new storyboard that is built on TabBarController[](https://i.stack.imgur.com/yB0D2.jpg)
Item 2, which is the middle one is l... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42224289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4099225/"
] | Here is your requirement as per the JSON you given.
You can use the power of `ng-repeat` and use **`$index`** to get your solution done.
```js
angular.module('App', [])
.controller('Ctrl', function($scope) {
$scope.arr = [
[{name:'John'},{name:'Sarah'},{name:'Ann'},{name:'Josh'},{name:'Mike'},{name:'O... | Here you go: <http://codepen.io/DaniloPolani/pen/BpMrvg>
The logic is to iterate the array saving the index (with angular, you can do this with `track by $index`).
With that index, you can retrieve the correct array position for each property (`arr[0][$index].name`, where `arr[0]` is the array of names and `$index` t... |
42,224,289 | I have a login page that is built in a file called LoginViewController.swift
After the user logs in, I want to send them to a new storyboard that is built on TabBarController[](https://i.stack.imgur.com/yB0D2.jpg)
Item 2, which is the middle one is l... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42224289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4099225/"
] | Here you go: <http://codepen.io/DaniloPolani/pen/BpMrvg>
The logic is to iterate the array saving the index (with angular, you can do this with `track by $index`).
With that index, you can retrieve the correct array position for each property (`arr[0][$index].name`, where `arr[0]` is the array of names and `$index` t... | If you don't have access to server to change format of your data (which would be the best solution), use custom function and format it properly in controller.
With `formatArray` you'll be able to use filters, such as orderBy, enable search feature, etc.
```js
angular.module('App', [])
.controller('Ctrl', function... |
42,224,289 | I have a login page that is built in a file called LoginViewController.swift
After the user logs in, I want to send them to a new storyboard that is built on TabBarController[](https://i.stack.imgur.com/yB0D2.jpg)
Item 2, which is the middle one is l... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42224289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4099225/"
] | Here is your requirement as per the JSON you given.
You can use the power of `ng-repeat` and use **`$index`** to get your solution done.
```js
angular.module('App', [])
.controller('Ctrl', function($scope) {
$scope.arr = [
[{name:'John'},{name:'Sarah'},{name:'Ann'},{name:'Josh'},{name:'Mike'},{name:'O... | If you don't have access to server to change format of your data (which would be the best solution), use custom function and format it properly in controller.
With `formatArray` you'll be able to use filters, such as orderBy, enable search feature, etc.
```js
angular.module('App', [])
.controller('Ctrl', function... |
28,746,822 | For some reason, in API 21, the app crashes every time i use a theme of "no action bar".
I saw here in another question that i should add `this.getActionBar().hide();`, so i tried it with a several different themes but it's not working.
Can someone explain to me why this is happening and what's the solution for that? | 2015/02/26 | [
"https://Stackoverflow.com/questions/28746822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3311377/"
] | If you're getting a NullPointerException on
```
this.getActionBar().hide();
```
then that means your Activity has no Action Bar.
Hiding the system bars has been changed since KitKat. If you're trying to go into full screen mode you'll probably have to play around with the System UI Visibility flags. Check out t... | Modify your styles.xml using this theme
```
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
```
If your ... |
28,792,419 | ```
SELECT SQL_NO_CACHE TIME_FORMAT(ADDTIME(journey.departure
, SEC_TO_TIME(SUM(link2.elapsed))), '%H:%i') AS departure
FROM journey
JOIN journey_day
ON journey_day.journey = journey.code
JOIN pattern
ON pattern.code = journey.pattern
JOIN service
ON service.code = pattern.service
JOIN link
... | 2015/03/01 | [
"https://Stackoverflow.com/questions/28792419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3605739/"
] | As the error tells you R requires at least one of the three options, e.g.,
```
Rserve(args="--no-save")
``` | I think you cannot start Rserve from within Rstudio because this does not start R with `--save`, `--no-save`, or `--vanilla`. The solution is to launch R from the command line with the appropriate command line arguments, and start Rserve from that. |
53,523 | I have my library that uses `Serial`, `Serial1` and `Serial2` to establish various logging scenarios. Library user would define the config at class constructor, using simple byte constants like 0, 1 and 2.
Problem is, `Serial1` and `Serial2` are not available in all board types. So when I compile my code (that compile... | 2018/06/11 | [
"https://arduino.stackexchange.com/questions/53523",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/47287/"
] | [HardwareSerial.h](https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/HardwareSerial.h) in Arduino AVR boards core defines HAVE\_HWSERIALX
example
```
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif
``` | Consider the approach used [here in the ArduinoBoardManager project at github](https://github.com/backupbrain/ArduinoBoardManager). The file [ArduinoBoardManager.h](https://github.com/backupbrain/ArduinoBoardManager/blob/master/ArduinoBoardManager.h) uses conditional compiling to determine the correct code to compile b... |
83,863 | I've got the new Canon Pixma MG 3150 and so far, I can't seem to find a driver anywhere. I do have the CD for both Windows and Mac, but this doesn't help me, as I have Ubuntu 11.10. I'd prefer to have it running on the wifi.
I'm really new to this, so I need for you to explain this to me as basically as possible. | 2011/11/29 | [
"https://askubuntu.com/questions/83863",
"https://askubuntu.com",
"https://askubuntu.com/users/35969/"
] | <http://support-sg.canon-asia.com/contents/SG/EN/0100393702.html>
try with this one! You have deb file inside. Just choos correct one and simply install | On canon site search for i.e. cnijfilter-mg5300series-3.60-1-deb (I have a MG 5350 printer, wifi only attached now on ubuntu 11.10) or i.e.: - canon your(series)type debian
Downloadded it, extracted to desktop
see files, right click the one ending on .sh
open in terminal
execute in terminal
it does its thing, no... |
29,253,375 | I have an `NSWindow` which can be closed and reopened (I've called `[setReleasedWhenClosed: NO]`). How do I check if it is open or closed programmatically?
I've read the doc and Googled but can't see a sane way to do this. `[isVisible]` is deprecated. `[occlusionState]` isn't what I'm after. I've worked around it usin... | 2015/03/25 | [
"https://Stackoverflow.com/questions/29253375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1180135/"
] | `-[NSWindow isVisible]` is not really deprecated.
For the 10.10 SDK, Apple went through and converted a bunch of informal properties to declared properties. An informal property is one for which there are just accessors declared, possibly just a getter method. A declared property uses `@property`.
As a consequence, t... | You make make of use of screen property of NSWindow. If the window in offscreen it will return nil. Please check <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/index.html#//apple_ref/occ/instm/NSWindow/screen> |
807,991 | ### ifconfig
```
eth0 Link encap:Ethernet HWaddr 54:04:a6:3d:36:ff
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B... | 2016/10/09 | [
"https://serverfault.com/questions/807991",
"https://serverfault.com",
"https://serverfault.com/users/272311/"
] | Let libvirt handle this. Libvirt has a default NAT network that will handle all of your forwarding, masquerading, and addressing for you. This NAT network comes pre-configured in libvirt deployments, and is literally named "default". The NAT is the most reasonable way to get internet access into a VM over a WiFi connec... | Bridge still should possible to do by using `wpa_supplicant` & `iw` & `brctl` trio.
`wpa_supplicant -B -b br0 -i wlan0 -c wpa.conf -Dwext`
**wpa\_supplicant** - Wi-Fi Protected Access client and IEEE 802.1X supplicant
* `-B` Run daemon in the background.
* `-b br_ifname` Optional bridge interface name. (Per interfa... |
6,801,903 | I have a list with 200 divs,
```
<div id="sId_1" class="sDiv"></div>
<div id="sId_2" class="sDiv"></div>
....
<div id="sId_200" class="sDiv"></div>.
```
What of the following two is faster?
```
-- each loop -- with i++;
<div onclick="callSomeFunction('click');" id="sId_'+i+'" ></div>
-- each loop --
-- each l... | 2011/07/23 | [
"https://Stackoverflow.com/questions/6801903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2136202/"
] | You can use event delegation to attach a single "smart" event handler to a suitable parent container:
```
$("#parent").delegate("div[id^='sId']", "click", function() {
// do something
});
```
Advantages of the above approach:
* Only one event handler.
* Can be attached to a jQuery object as opposed to a selecto... | The first is the fastest, but it will cost you with size page.
The second need to be fixed, because you will not do this to 100 divs.
So you can make each div a class which you will then call like this:
```
$(".divPRessable").click( ...
```
The last is only faster if you going to inject divs to DOM (slowest). |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | **Method 1:** Wrap telephone number in `b` or `strong` tag.
```html
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more information on what I have been working on, I'd
love to hear from you!</p>
<p>Phone: <strong>0064 1122334455</strong></p>
... | You can use the `b` tag to make text bold.
Or use css to set styles for this element.
```html
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more information on what I
have been working on, I'd love to hear from you!</p>
... |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | For that you have to use **CSS** `font-weight` property.
```html
<html>
<head>
<style>
p.normal {
font-weight: normal;
}
p.light {
font-weight: lighter;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
</style>
</head>
<body>
<p class="normal">Hello</p>
<p class="... | ```
jsfiddle.net/75nwgqop/
#phoneNumber {
font-weight : bold;
}
```
Provide the paragraph tag an id 'phoneNumber'. Then in the css file just add font-weight property to the id 'phoneNumber'. |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | **Method 1:** Wrap telephone number in `b` or `strong` tag.
```html
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more information on what I have been working on, I'd
love to hear from you!</p>
<p>Phone: <strong>0064 1122334455</strong></p>
... | Use **bold** tag
```
<p>Phone: <b>0064 1122334455</b></p>
``` |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Just use **Bold** Tag like this `<b>0064 1122334455</b>` . | ```
jsfiddle.net/75nwgqop/
#phoneNumber {
font-weight : bold;
}
```
Provide the paragraph tag an id 'phoneNumber'. Then in the css file just add font-weight property to the id 'phoneNumber'. |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Just use **Bold** Tag like this `<b>0064 1122334455</b>` . | Use the [font-weight](https://developer.mozilla.org/en/docs/Web/CSS/font-weight) field in CSS:
```
.bold{
font-weight:bold;
}
```
and add a span tag surrounding the phone number:
```
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more informatio... |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | you can use something like this: `<p><b> Phone: 0064 1122334455 </b> </p>` | ```
jsfiddle.net/75nwgqop/
#phoneNumber {
font-weight : bold;
}
```
Provide the paragraph tag an id 'phoneNumber'. Then in the css file just add font-weight property to the id 'phoneNumber'. |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Use the [font-weight](https://developer.mozilla.org/en/docs/Web/CSS/font-weight) field in CSS:
```
.bold{
font-weight:bold;
}
```
and add a span tag surrounding the phone number:
```
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more informatio... | ```
jsfiddle.net/75nwgqop/
#phoneNumber {
font-weight : bold;
}
```
Provide the paragraph tag an id 'phoneNumber'. Then in the css file just add font-weight property to the id 'phoneNumber'. |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Just use **Bold** Tag like this `<b>0064 1122334455</b>` . | You can use the `b` tag to make text bold.
Or use css to set styles for this element.
```html
<div id="contact_info">
<h3><a id="contact">Contact</a></h3>
<p>If you are interested in chatting or want more information on what I
have been working on, I'd love to hear from you!</p>
... |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Just use **Bold** Tag like this `<b>0064 1122334455</b>` . | you can use something like this: `<p><b> Phone: 0064 1122334455 </b> </p>` |
38,586,881 | i'm getting the following error while trying to run PostgreSQL with PHP & Apache on OS X El Capitan:
>
> Fatal error: Call to undefined function pg\_connect()
>
>
>
I have setup Apache & PHP recently and wanted now to add PostgreSQL for database queries. Postgres.app worked well with Java so far. I'm afraid that ... | 2016/07/26 | [
"https://Stackoverflow.com/questions/38586881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6638948/"
] | Use **bold** tag
```
<p>Phone: <b>0064 1122334455</b></p>
``` | ```
jsfiddle.net/75nwgqop/
#phoneNumber {
font-weight : bold;
}
```
Provide the paragraph tag an id 'phoneNumber'. Then in the css file just add font-weight property to the id 'phoneNumber'. |
26,079,469 | I tried to get the result of -1 modulo 1000000007 using the `%` operator of C++
and [`fmod`](http://www.cplusplus.com/reference/cmath/fmod/) function.
The output is `-1`, but `-1 modulo 1000000007==1000000006`.
What have I done wrong? | 2014/09/27 | [
"https://Stackoverflow.com/questions/26079469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2715780/"
] | Plainly said, you took the wrong operator.
C++ and C `%` **is not** modulo, but remainder.
```
assert(a / b * b + a % b == a); // for integral types
```
If `a` is non-negative, modulo and remainder are the same.
Otherwise the return-value is negative, just add `b`.
```
template<class T>
inline constexpr auto
modu... | Modulo function that handles negative divisors as well as positive divisors:
```
template<class T>
inline constexpr auto
modulo(T a, T b) -> decltype(a%b) {
auto r = a % b;
if((b > 0 && r < 0) || (b < 0 && r > 0))
r += b;
return r;
}
``` |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | This answer from askubuntu is what worked for me. Seems simpler than other options an less error-prone, since it uses package `libgtest-dev` to get the sources and builds from there: <https://askubuntu.com/questions/145887/why-no-library-files-installed-for-google-test?answertab=votes#tab-top>
Please refer to that ans... | This will build and install both gtest and gmock 1.7.0:
```
mkdir /tmp/googleTestMock
tar -xvf googletest-release-1.7.0.tar.gz -C /tmp/googleTestMock
tar -xvf googlemock-release-1.7.0.tar.gz -C /tmp/googleTestMock
cd /tmp/googleTestMock
mv googletest-release-1.7.0 gtest
cd googlemock-release-1.7.0
cmake -DBUILD_SHARED... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | It took me a while to figure out this because the normal "make install" has been removed and I don't use cmake. Here is my experience to share. At work, I don't have root access on Linux, so I installed the Google test framework under my home directory: `~/usr/gtest/`.
To install the package in ~/usr/gtest/ as shared ... | This will install google test and mock library in Ubuntu/Debian based system:
```
sudo apt-get install google-mock
```
Tested in google cloud in debian based image. |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | Let me answer this specifically for ubuntu users.
First start by installing the gtest development package.
```
sudo apt-get install libgtest-dev
```
Note that this package only install source files. You have to compile the code yourself to create the necessary library files. These source files should be located at /... | If you happen to be using CMake, you can use [`ExternalProject_Add`](http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject) as described [here](https://stackoverflow.com/a/9695234/424459).
This avoids you having to keep gtest source code in your repository, or installing it anywhere. It is download... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | It took me a while to figure out this because the normal "make install" has been removed and I don't use cmake. Here is my experience to share. At work, I don't have root access on Linux, so I installed the Google test framework under my home directory: `~/usr/gtest/`.
To install the package in ~/usr/gtest/ as shared ... | **Update for Debian/Ubuntu**
Google Mock (package: `google-mock`) and Google Test (package: `libgtest-dev`) have been merged. The new package is called `googletest`. Both old names are still available for backwards compatibility and now depend on the new package `googletest`.
So, to get your libraries from the packag... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | Before you start make sure your have read and understood
[this note from Google](https://github.com/google/googletest/blob/36066cfecf79267bdf46ff82ca6c3b052f8f633c/googletest/docs/faq.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal)! This tutorial makes using gtest e... | This answer from askubuntu is what worked for me. Seems simpler than other options an less error-prone, since it uses package `libgtest-dev` to get the sources and builds from there: <https://askubuntu.com/questions/145887/why-no-library-files-installed-for-google-test?answertab=votes#tab-top>
Please refer to that ans... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | It took me a while to figure out this because the normal "make install" has been removed and I don't use cmake. Here is my experience to share. At work, I don't have root access on Linux, so I installed the Google test framework under my home directory: `~/usr/gtest/`.
To install the package in ~/usr/gtest/ as shared ... | If you happen to be using CMake, you can use [`ExternalProject_Add`](http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject) as described [here](https://stackoverflow.com/a/9695234/424459).
This avoids you having to keep gtest source code in your repository, or installing it anywhere. It is download... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | If you happen to be using CMake, you can use [`ExternalProject_Add`](http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject) as described [here](https://stackoverflow.com/a/9695234/424459).
This avoids you having to keep gtest source code in your repository, or installing it anywhere. It is download... | This will install google test and mock library in Ubuntu/Debian based system:
```
sudo apt-get install google-mock
```
Tested in google cloud in debian based image. |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | If you happen to be using CMake, you can use [`ExternalProject_Add`](http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:ExternalProject) as described [here](https://stackoverflow.com/a/9695234/424459).
This avoids you having to keep gtest source code in your repository, or installing it anywhere. It is download... | Just in case somebody else gets in the same situation like me yesterday (2016-06-22) and also does not succeed with the already posted approaches - on `Lubuntu 14.04` it worked for me using the following chain of commands:
```
git clone https://github.com/google/googletest
cd googletest
cmake -DBUILD_SHARED_LIBS=ON .
... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | This will install google test and mock library in Ubuntu/Debian based system:
```
sudo apt-get install google-mock
```
Tested in google cloud in debian based image. | For 1.8.1 based on @ManuelSchneid3r 's answer
I had to do:
```
wget github.com/google/googletar xf release-1.8.1.tar.gz
tar xf release-1.8.1.tar.gz
cd googletest-release-1.8.1/
cmake -DBUILD_SHARED_LIBS=ON .
make
```
I then did `make install` which seemed to work for 1.8.1, but
following @ManuelSchneid3r it would... |
13,513,905 | Debian does not provide any precompiled packages for gTest anymore. They suggest you integrate the framework into your project's makefile. But I want to keep my makefile clean. How do I set up gTest like the former versions (<1.6.0), so that I can link against the library? | 2012/11/22 | [
"https://Stackoverflow.com/questions/13513905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/978486/"
] | Before you start make sure your have read and understood
[this note from Google](https://github.com/google/googletest/blob/36066cfecf79267bdf46ff82ca6c3b052f8f633c/googletest/docs/faq.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal)! This tutorial makes using gtest e... | Let me answer this specifically for ubuntu users.
First start by installing the gtest development package.
```
sudo apt-get install libgtest-dev
```
Note that this package only install source files. You have to compile the code yourself to create the necessary library files. These source files should be located at /... |
36,779,445 | So, I have an ArrayList that is taken from a .txt file. It displays the following details:
```
Id
Car Manufacturer
Car Type
Colour
*blank line*
```
For Example:
```
21
Vauxhall
Corsa
red
19
Vauxhall
Corsa
blue
18
Vauxhall
Corsa
White
```
I am curious as how to make the Id the "index" of an ArrayList, so that if... | 2016/04/21 | [
"https://Stackoverflow.com/questions/36779445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You need to to destroy current instance of **cropit** using -
`$('.image-editor').cropit('destroy');` | You've wrapped the entire `cropit` code inside of a `$(function() {});` block. I don't think this is what you want, as that function only fires the first time you click. You can see it failing by throwing an alert inside that function and clicking a few times; it only fires on the first click.
If you just remove the `... |
58,696,951 | Say I have this (stuck with C++03).
```
template <class T, int S>
class FiniteMap
{
public:
class Iterator {};
class Entry {};
};
class Foo {};
template <class T, int S>
class FooMap : public FiniteMap<T,S>
{
public:
void bar()
{
FooMap<T,S>::Iterator iter;
FooMap<T,S>::Entry entry... | 2019/11/04 | [
"https://Stackoverflow.com/questions/58696951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931123/"
] | C++11 has `using for this :)
When I tried on C++03, I got the error "need `typename` before `FiniteMap` as it is a dependent scope...
Thus:
```
template <class T, int S>
class FiniteMap {
public:
class Iterator {};
class Entry {};
};
class Foo {};
template <class T, int S>
class FooMap : public FiniteMap<T... | With
```
typedef FooMap<T,S>::Iterator FooIterator;
```
compiler complains about T (and probably S) not being declared - and I have to agree.
If you want to keep T abstract, then you are stuck with using the parameterised template.
But I think you actually want to typedef a "short" for the specific case of T=Foo... |
13,868,801 | I'm trying to create my own [Authorize] Attribute so I can use my own authorize logic to have hierarchal roles.
If someone does `[Authorize(Roles = "Admin")]` on a controller or action
How do I get the string "Admin" in my AuthorizeCore function?
I'm using this code:
```
public class Authorize : AuthorizeAttribute
... | 2012/12/13 | [
"https://Stackoverflow.com/questions/13868801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308743/"
] | It is quit a common thing that you have faced with.
This recommendation in post should work in MVC4 as it is working in MVC 3: - [ASP.NET MVC - Alternative to Role Provider?](https://stackoverflow.com/q/4837103/1437962)
```
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
bool isAd... | Roles is a public property. You should be able to do this:
```
public class Authorize : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
if(Roles.Contains("MyRole"))
return true;
return false;
}
}
```
Or whatever it is that you need to... |
13,868,801 | I'm trying to create my own [Authorize] Attribute so I can use my own authorize logic to have hierarchal roles.
If someone does `[Authorize(Roles = "Admin")]` on a controller or action
How do I get the string "Admin" in my AuthorizeCore function?
I'm using this code:
```
public class Authorize : AuthorizeAttribute
... | 2012/12/13 | [
"https://Stackoverflow.com/questions/13868801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308743/"
] | It is quit a common thing that you have faced with.
This recommendation in post should work in MVC4 as it is working in MVC 3: - [ASP.NET MVC - Alternative to Role Provider?](https://stackoverflow.com/q/4837103/1437962)
```
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
bool isAd... | If you need to get the list of allowed roles, you can simply get the Roles property. It will list the string that was specified in the attribute decoration.
```
public class Authorize : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
var allowedRoles = Roles;
... |
13,868,801 | I'm trying to create my own [Authorize] Attribute so I can use my own authorize logic to have hierarchal roles.
If someone does `[Authorize(Roles = "Admin")]` on a controller or action
How do I get the string "Admin" in my AuthorizeCore function?
I'm using this code:
```
public class Authorize : AuthorizeAttribute
... | 2012/12/13 | [
"https://Stackoverflow.com/questions/13868801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308743/"
] | Roles is a public property. You should be able to do this:
```
public class Authorize : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
if(Roles.Contains("MyRole"))
return true;
return false;
}
}
```
Or whatever it is that you need to... | If you need to get the list of allowed roles, you can simply get the Roles property. It will list the string that was specified in the attribute decoration.
```
public class Authorize : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
var allowedRoles = Roles;
... |
5,834,334 | How can i do forward jumps like this?? Eclipse is complaining label1 is not found...
Thx
```
public class foo {
int xyz() {
int b = 1;
if (b == 0) {
break label1;
}
// MORE CODE HERE
label1:
return 1;
}
}
``` | 2011/04/29 | [
"https://Stackoverflow.com/questions/5834334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450741/"
] | You are trying to use the equivalent of `goto` in Java. You can't, and for good reason. Abandon ship.
Labels are included in Java for the sole reason of choosing *which* **loop or switch** to break out of, in the case of nested loops (or switch statements). They have no other purpose, and even that single purpose is o... | You can't do that. You can only break out of an **enclosing** loop structure. You don't have a loop structure at all. Try this instead:
```
public class foo {
int xyz() {
int b = 1;
boolean skip = false;
if (b == 0) {
skip = true;
}
if (!skip) {
//... |
5,834,334 | How can i do forward jumps like this?? Eclipse is complaining label1 is not found...
Thx
```
public class foo {
int xyz() {
int b = 1;
if (b == 0) {
break label1;
}
// MORE CODE HERE
label1:
return 1;
}
}
``` | 2011/04/29 | [
"https://Stackoverflow.com/questions/5834334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450741/"
] | You are trying to use the equivalent of `goto` in Java. You can't, and for good reason. Abandon ship.
Labels are included in Java for the sole reason of choosing *which* **loop or switch** to break out of, in the case of nested loops (or switch statements). They have no other purpose, and even that single purpose is o... | I addition to the previous answers, why not just
```
if (b == 0) {
return 1;
}
```
? |
5,834,334 | How can i do forward jumps like this?? Eclipse is complaining label1 is not found...
Thx
```
public class foo {
int xyz() {
int b = 1;
if (b == 0) {
break label1;
}
// MORE CODE HERE
label1:
return 1;
}
}
``` | 2011/04/29 | [
"https://Stackoverflow.com/questions/5834334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450741/"
] | Labels are only applicable to loops (and blocks in general). And you are trying to mimic a `goto`. Don't. | You can't do that. You can only break out of an **enclosing** loop structure. You don't have a loop structure at all. Try this instead:
```
public class foo {
int xyz() {
int b = 1;
boolean skip = false;
if (b == 0) {
skip = true;
}
if (!skip) {
//... |
5,834,334 | How can i do forward jumps like this?? Eclipse is complaining label1 is not found...
Thx
```
public class foo {
int xyz() {
int b = 1;
if (b == 0) {
break label1;
}
// MORE CODE HERE
label1:
return 1;
}
}
``` | 2011/04/29 | [
"https://Stackoverflow.com/questions/5834334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450741/"
] | Labels are only applicable to loops (and blocks in general). And you are trying to mimic a `goto`. Don't. | I addition to the previous answers, why not just
```
if (b == 0) {
return 1;
}
```
? |
5,834,334 | How can i do forward jumps like this?? Eclipse is complaining label1 is not found...
Thx
```
public class foo {
int xyz() {
int b = 1;
if (b == 0) {
break label1;
}
// MORE CODE HERE
label1:
return 1;
}
}
``` | 2011/04/29 | [
"https://Stackoverflow.com/questions/5834334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450741/"
] | You can't do that. You can only break out of an **enclosing** loop structure. You don't have a loop structure at all. Try this instead:
```
public class foo {
int xyz() {
int b = 1;
boolean skip = false;
if (b == 0) {
skip = true;
}
if (!skip) {
//... | I addition to the previous answers, why not just
```
if (b == 0) {
return 1;
}
```
? |
62,245,970 | In my Python course I read these sentences:
"*The assignment: `list2 = list1` copies the name of the array, not its contents. In effect, the two names (`list1 and list2`) identify the same location in the computer memory. Modifying one of them affects the other, and vice versa.*"
Source available on Cisco Networking... | 2020/06/07 | [
"https://Stackoverflow.com/questions/62245970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13699945/"
] | Your first statement means that the new list `list2` is a reference to `list1`
**EDIT** : `list2` is actually not a new list, it is a reference to `list1`
Check This :
```
list1 = [1,2,3]
list2 = list1
print("List1 = ",list1,"List2 = ",list2)
```
Gives :
```
List1 = [1,2,3] List2 = [1,2,3]
```
And
```
lis... | The reason this happens is something called a *pointer*.
A pointer is simply a variable to a location in memory. This is how python lists work. When you set
```
foo = [1,2,3,4,5]
```
python sets the value of foo **not** to the actual list, but instead, to a memory location in the computer where the actual list is ... |
62,245,970 | In my Python course I read these sentences:
"*The assignment: `list2 = list1` copies the name of the array, not its contents. In effect, the two names (`list1 and list2`) identify the same location in the computer memory. Modifying one of them affects the other, and vice versa.*"
Source available on Cisco Networking... | 2020/06/07 | [
"https://Stackoverflow.com/questions/62245970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13699945/"
] | Your first statement means that the new list `list2` is a reference to `list1`
**EDIT** : `list2` is actually not a new list, it is a reference to `list1`
Check This :
```
list1 = [1,2,3]
list2 = list1
print("List1 = ",list1,"List2 = ",list2)
```
Gives :
```
List1 = [1,2,3] List2 = [1,2,3]
```
And
```
lis... | Great question. You're looking for the term [aliasing](http://pages.di.unipi.it/marino/python/Lists/Aliasing.html). Also take a look at the [id](https://stackoverflow.com/questions/15667189/what-is-the-id-function-used-for) function, which will help you internalize this idea. For our purposes, id() returns the unique i... |
28,569,867 | The title may be confusing, but I will try to explain it with the following example.
I have defined two different types of classes, CDMarker and PDLMarker. In a processing method as below, I create a arraylist for one of the types and use a foreach loop to analyze each one of them.
```
ArrayList<CDMarker> cdMarkers... | 2015/02/17 | [
"https://Stackoverflow.com/questions/28569867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4118822/"
] | Create the following classes and interface:
```
public interface Marker {
}
public class CDMarker implements Marker {
...
}
public class PDLMarker implements Marker {
...
}
```
Use them in the following way:
```
//Create list
List<Marker> markers = new ArrayList<Marker>();
//Add objects
if(condition1)
... | Yes, create a marker class and have CDMarker and PDLMarker inherit from that class. You can then loop through all your Marker objects in the way you listed.
EDIT: Here's a simple example I found. <http://examples.javacodegeeks.com/java-basics/java-inheritance-example/> |
28,569,867 | The title may be confusing, but I will try to explain it with the following example.
I have defined two different types of classes, CDMarker and PDLMarker. In a processing method as below, I create a arraylist for one of the types and use a foreach loop to analyze each one of them.
```
ArrayList<CDMarker> cdMarkers... | 2015/02/17 | [
"https://Stackoverflow.com/questions/28569867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4118822/"
] | Create the following classes and interface:
```
public interface Marker {
}
public class CDMarker implements Marker {
...
}
public class PDLMarker implements Marker {
...
}
```
Use them in the following way:
```
//Create list
List<Marker> markers = new ArrayList<Marker>();
//Add objects
if(condition1)
... | You could have both CDMarker and PDLMarker extends the same super class Marker. Then declare the ArrayList as a superclass ArrayList, then loop through. In the loop, you could have different conditions to invoke different methods on the objects.
```
Marker marker1; //declare as superclass
if condition1... |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | Came across this searching for an answer and I eventually just lucked on an answer of my own by messing about. I did
```
[[webview scrollView] setBounces:NO];
```
and it worked. | Here's two newer potential solutions. Apparently, you can use jqtouch or pastrykit to disable scrolling. However, I haven't got these to work. You might be more competent.
[turning off vertical scrolling](http://blog.jqtouch.com/post/285889760/turning-off-vertical-scrolling)
[digging into pastrykit](http://waynepan.c... |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | ```
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
```
...seems to work fine.
It'll be accepted to App Store as well.
**Update**: in iOS 5.x+ there's an easier way - `UIWebView` has `scrollView` property, so your code... | One of the subviews of `UIWebView` should be a `UIScrollView`. Set its `scrollEnabled` property to `NO` and the web view will have scrolling disabled entirely.
Note: this is technically using a private API and thus your app could be rejected or crash in future OS releases. Use `@try` and `respondsToSelector` |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | In the iOS 5 SDK you can access the scroll view associated with a web view directly rather than iterating through its subviews.
So to disable 'bouncing' in the scroll view you can use:
```
myWebView.scrollView.bounces = NO;
```
See the [UIWebView Class Reference](http://developer.apple.com/library/ios/#documentatio... | In Swift to disable bounces
```
webViewObj.scrollView.bounces = false
``` |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | ```
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
```
...seems to work fine.
It'll be accepted to App Store as well.
**Update**: in iOS 5.x+ there's an easier way - `UIWebView` has `scrollView` property, so your code... | webView.scrollView.scrollEnabled=NO;
webView.scrollView.bounces=NO; |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | Warning. I used setAllowsRubberBanding: in my app, and Apple rejected it, stating that non-public API functions are not allowed (cite: 3.3.1) | I traversed the collection of UIWebView's subviews and set their backgrounds to [UIColor blackColor], the same color as the webpage background. The view will still bounce but it will not show that ugly dark grey background. |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | Swift 3
```
webView.scrollView.bounces = false
``` | I traversed the collection of UIWebView's subviews and set their backgrounds to [UIColor blackColor], the same color as the webpage background. The view will still bounce but it will not show that ugly dark grey background. |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | Well all I did to accomplish this is :
```
UIView *firstView = [webView.subviews firstObject];
if ([firstView isKindOfClass:[UIScrollView class]]) {
UIScrollView *scroll = (UIScrollView*)firstView;
[scroll setScrollEnabled:NO]; //to stop scrolling completely
[scroll setBounces:NO]; //to stop bouncing
}
... | I traversed the collection of UIWebView's subviews and set their backgrounds to [UIColor blackColor], the same color as the webpage background. The view will still bounce but it will not show that ugly dark grey background. |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | I was looking at a project that makes it easy to create web apps as full fledged installable applications on the iPhone called [QuickConnect](http://sourceforge.net/projects/quickconnect/), and found a solution that works, if you don't want your screen to be scrollable at all, which in my case I didn't.
In the above m... | Came across this searching for an answer and I eventually just lucked on an answer of my own by messing about. I did
```
[[webview scrollView] setBounces:NO];
```
and it worked. |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | Brad's method worked for me. If you use it you might want to make it a little safer.
```
id scrollView = [yourWebView.subviews objectAtIndex:0];
if( [scrollView respondsToSelector:@selector(setAllowsRubberBanding:)] )
{
[scrollView performSelector:@selector(setAllowsRubberBanding:) withObject:NO];
}
```
If apple... | Look into the `bounces` property of `UIScrollView`. Quoth the Apple docs:
>
> If the value of the property is `YES` (the default), the scroll view bounces when it encounters a boundary of the content. Bouncing visually indicates that scrolling has reached an edge of the content. If the value is `NO`, scrolling stops ... |
500,761 | Does anyone know how to stop a UIWebView from bouncing vertically? I mean when a user touches their iphone screen, drags their finger downwards, and the webview shows a blank spot above the web page I had loaded?
I've looked at the following possible solutions, but none of them worked for me:
<http://www.iphonedevsdk... | 2009/02/01 | [
"https://Stackoverflow.com/questions/500761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26510/"
] | In the iOS 5 SDK you can access the scroll view associated with a web view directly rather than iterating through its subviews.
So to disable 'bouncing' in the scroll view you can use:
```
myWebView.scrollView.bounces = NO;
```
See the [UIWebView Class Reference](http://developer.apple.com/library/ios/#documentatio... | Came across this searching for an answer and I eventually just lucked on an answer of my own by messing about. I did
```
[[webview scrollView] setBounces:NO];
```
and it worked. |
41,412,512 | I'm using the promis module to return my json data from the request module, but every time i run it, it gives me this.
```
Promise { _45: 0, _81: 0, _65: null, _54: null }
```
I can't get it to work, any one know the problem? here is my code:
```
function parse(){
return new Promise(function(json){
request('htt... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7338765/"
] | A promise is an object that serves as a placeholder for a future value. Your `parse()` function returns that promise object. You get the future value in that promise by attaching a `.then()` handler to the promise like this:
```
function parse(){
return new Promise(function(resolve, reject){
request('https... | Use [request-promise](https://www.npmjs.com/package/request-promise):
```
var rp = require('request-promise');
rp('http://www.google.com')
.then(function (response) {
// resolved
})
.catch(function (err) {
// rejected
});
``` |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | I successfully used [SMS Backup+](https://github.com/jberkel/sms-backup-plus), version 1.5.7 installed via [F-Droid package](https://f-droid.org/packages/com.zegoggles.smssync/).
That version addresses an [issue (#460) for SMS Backup+](https://github.com/jberkel/sms-backup-plus/issues/460) to account for the [sudden c... | The best method to backup/export sms(and others like contacts) is using [Titanium Backup](https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup&hl=en) app.
Note: While importing use setting "Let me choose myself." This is recommended for inter-version import/export. |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | There are several apps supporting to [Backup SMS/MMS](http://android.izzysoft.de/applists/category/named/file_backup#group_133) (and of course also to restore them), running *locally* in "user-mode" (if you prefer cloud storage, which by the question you do *not*, there are also ways to [Backup SMS into the Cloud](http... | There is a branch of slight backup which has the Fix for Android 4.4, but it seems like there are not prebuilt apks for it (yet):
<https://github.com/handschuh/Slight-backup/tree/smsrestore_4.4> |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | [QKSMS](https://github.com/moezbhatti/qksms) ([free software](https://www.gnu.org/philosophy/free-sw.html), available on [F-Droid](https://f-droid.org/packages/com.moez.QKSMS/)) does the job. It is a messaging app that has a *Backup and Restore* feature. *Backup* exports messages to a JSON file, and *Restore* inserts m... | The best method to backup/export sms(and others like contacts) is using [Titanium Backup](https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup&hl=en) app.
Note: While importing use setting "Let me choose myself." This is recommended for inter-version import/export. |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | [QKSMS](https://github.com/moezbhatti/qksms) ([free software](https://www.gnu.org/philosophy/free-sw.html), available on [F-Droid](https://f-droid.org/packages/com.moez.QKSMS/)) does the job. It is a messaging app that has a *Backup and Restore* feature. *Backup* exports messages to a JSON file, and *Restore* inserts m... | [SMS Backup and Restore](https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore) did the job for me when I migrated from my Atrix to Nexus 4. The app is free but the developer accepts donations if you like his software. The app backs up messages as an XML file. |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | [QKSMS](https://github.com/moezbhatti/qksms) ([free software](https://www.gnu.org/philosophy/free-sw.html), available on [F-Droid](https://f-droid.org/packages/com.moez.QKSMS/)) does the job. It is a messaging app that has a *Backup and Restore* feature. *Backup* exports messages to a JSON file, and *Restore* inserts m... | There is a branch of slight backup which has the Fix for Android 4.4, but it seems like there are not prebuilt apks for it (yet):
<https://github.com/handschuh/Slight-backup/tree/smsrestore_4.4> |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | There are several apps supporting to [Backup SMS/MMS](http://android.izzysoft.de/applists/category/named/file_backup#group_133) (and of course also to restore them), running *locally* in "user-mode" (if you prefer cloud storage, which by the question you do *not*, there are also ways to [Backup SMS into the Cloud](http... | [SMS Backup and Restore](https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore) did the job for me when I migrated from my Atrix to Nexus 4. The app is free but the developer accepts donations if you like his software. The app backs up messages as an XML file. |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | There are several apps supporting to [Backup SMS/MMS](http://android.izzysoft.de/applists/category/named/file_backup#group_133) (and of course also to restore them), running *locally* in "user-mode" (if you prefer cloud storage, which by the question you do *not*, there are also ways to [Backup SMS into the Cloud](http... | I successfully used [SMS Backup+](https://github.com/jberkel/sms-backup-plus), version 1.5.7 installed via [F-Droid package](https://f-droid.org/packages/com.zegoggles.smssync/).
That version addresses an [issue (#460) for SMS Backup+](https://github.com/jberkel/sms-backup-plus/issues/460) to account for the [sudden c... |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | I successfully used [SMS Backup+](https://github.com/jberkel/sms-backup-plus), version 1.5.7 installed via [F-Droid package](https://f-droid.org/packages/com.zegoggles.smssync/).
That version addresses an [issue (#460) for SMS Backup+](https://github.com/jberkel/sms-backup-plus/issues/460) to account for the [sudden c... | There is a branch of slight backup which has the Fix for Android 4.4, but it seems like there are not prebuilt apks for it (yet):
<https://github.com/handschuh/Slight-backup/tree/smsrestore_4.4> |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | There are several apps supporting to [Backup SMS/MMS](http://android.izzysoft.de/applists/category/named/file_backup#group_133) (and of course also to restore them), running *locally* in "user-mode" (if you prefer cloud storage, which by the question you do *not*, there are also ways to [Backup SMS into the Cloud](http... | The best method to backup/export sms(and others like contacts) is using [Titanium Backup](https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackup&hl=en) app.
Note: While importing use setting "Let me choose myself." This is recommended for inter-version import/export. |
86,349 | How can I backup and restore SMS message history, and restore on a later Android version — using only the SD card storage?
I am upgrading from one device to another:
* Existing device: [Google Nexus One](http://www.gsmarena.com/htc_google_nexus_one-3069.php) running Android 2.3 Gingerbread ([CyanogenMod 7.1](https://... | 2014/10/31 | [
"https://android.stackexchange.com/questions/86349",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/7046/"
] | There are several apps supporting to [Backup SMS/MMS](http://android.izzysoft.de/applists/category/named/file_backup#group_133) (and of course also to restore them), running *locally* in "user-mode" (if you prefer cloud storage, which by the question you do *not*, there are also ways to [Backup SMS into the Cloud](http... | [QKSMS](https://github.com/moezbhatti/qksms) ([free software](https://www.gnu.org/philosophy/free-sw.html), available on [F-Droid](https://f-droid.org/packages/com.moez.QKSMS/)) does the job. It is a messaging app that has a *Backup and Restore* feature. *Backup* exports messages to a JSON file, and *Restore* inserts m... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | Add `android:manageSpaceActivity=".ActivityOfMyChoice"` to the `application` tag of your Manifest like:
```
<application android:label="MyApp" android:icon="@drawable/icon"
android:manageSpaceActivity=".ActivityOfMyChoice">
```
Then instead of `"Clear Data"`, there is a button for `"Manage Spac... | There is no way to prevent the user from clearing your app data. The manifest option you mention is intended for system apps only and you, as a developer, have no way to install system apps.
Please see [this discussion](http://groups.google.com/group/android-developers/browse_thread/thread/b1091f190f7356b7?pli=1) for ... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | AndroidManifest.xml
```
<application
android:manageSpaceActivity="[packageName].ManageSpaceActivity"
...
...
>
<activity
android:name="[packageName].ManageSpaceActivity"
android:screenOrientation="portrait" />
```
it will call my activity, but:
```
public class ManageSpaceActivity extends Act... | There is no way to prevent the user from clearing your app data. The manifest option you mention is intended for system apps only and you, as a developer, have no way to install system apps.
Please see [this discussion](http://groups.google.com/group/android-developers/browse_thread/thread/b1091f190f7356b7?pli=1) for ... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | There is no way to prevent the user from clearing your app data. The manifest option you mention is intended for system apps only and you, as a developer, have no way to install system apps.
Please see [this discussion](http://groups.google.com/group/android-developers/browse_thread/thread/b1091f190f7356b7?pli=1) for ... | Just a trick.
```
<application
android:manageSpaceActivity="{packageName}.ManageSpaceActivity"
>
```
In this scenario Android OS will show a Manage Space button in place of clear data.
Upon clicking it will open ManageSpaceActivity.
**But**
```
<application
android:manageSpaceActivity=".AnyActivit... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | Add `android:manageSpaceActivity=".ActivityOfMyChoice"` to the `application` tag of your Manifest like:
```
<application android:label="MyApp" android:icon="@drawable/icon"
android:manageSpaceActivity=".ActivityOfMyChoice">
```
Then instead of `"Clear Data"`, there is a button for `"Manage Spac... | AndroidManifest.xml
```
<application
android:manageSpaceActivity="[packageName].ManageSpaceActivity"
...
...
>
<activity
android:name="[packageName].ManageSpaceActivity"
android:screenOrientation="portrait" />
```
it will call my activity, but:
```
public class ManageSpaceActivity extends Act... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | Add `android:manageSpaceActivity=".ActivityOfMyChoice"` to the `application` tag of your Manifest like:
```
<application android:label="MyApp" android:icon="@drawable/icon"
android:manageSpaceActivity=".ActivityOfMyChoice">
```
Then instead of `"Clear Data"`, there is a button for `"Manage Spac... | Just a trick.
```
<application
android:manageSpaceActivity="{packageName}.ManageSpaceActivity"
>
```
In this scenario Android OS will show a Manage Space button in place of clear data.
Upon clicking it will open ManageSpaceActivity.
**But**
```
<application
android:manageSpaceActivity=".AnyActivit... |
6,531,173 | I am working on android 2.2, In a Application tab of android manifest provide the option of "Allow clear data" to set true or false. But after setting it to False, my application can't disable the button of Clear data in application info of Manage application. I am facing this problem when application contains database... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6531173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/820827/"
] | AndroidManifest.xml
```
<application
android:manageSpaceActivity="[packageName].ManageSpaceActivity"
...
...
>
<activity
android:name="[packageName].ManageSpaceActivity"
android:screenOrientation="portrait" />
```
it will call my activity, but:
```
public class ManageSpaceActivity extends Act... | Just a trick.
```
<application
android:manageSpaceActivity="{packageName}.ManageSpaceActivity"
>
```
In this scenario Android OS will show a Manage Space button in place of clear data.
Upon clicking it will open ManageSpaceActivity.
**But**
```
<application
android:manageSpaceActivity=".AnyActivit... |
504,366 | I would like to use Zapf's Palatino font for the text in my document, which also includes a lot of maths. And I would like a good font for the maths. This is a snapshot of what I am doing.
```
\documentclass[10pt,letterpaper]{memoir}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathpple}
\usepackage{upgreek}
... | 2019/08/15 | [
"https://tex.stackexchange.com/questions/504366",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/12082/"
] | I suggest that you not load the `mathpple`, `mathpazo`, and `upgreek` packages and, instead, load the `newpxtext` and `newpxmath` packages.
[](https://i.stack.imgur.com/kGiwH.png)
```
\documentclass[10pt,letterpaper]{memoir}
\usepackage{amsmath,amssy... | You can also do this with OpenType fonts using `unicode-math`.
```
\documentclass[10pt,letterpaper]{memoir}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{microtype}
\usepackage{lipsum}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}
\setmathfont{Asana Math}
\begin{document}
\c... |
504,366 | I would like to use Zapf's Palatino font for the text in my document, which also includes a lot of maths. And I would like a good font for the maths. This is a snapshot of what I am doing.
```
\documentclass[10pt,letterpaper]{memoir}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathpple}
\usepackage{upgreek}
... | 2019/08/15 | [
"https://tex.stackexchange.com/questions/504366",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/12082/"
] | I suggest that you not load the `mathpple`, `mathpazo`, and `upgreek` packages and, instead, load the `newpxtext` and `newpxmath` packages.
[](https://i.stack.imgur.com/kGiwH.png)
```
\documentclass[10pt,letterpaper]{memoir}
\usepackage{amsmath,amssy... | I would avoid using `TeX Gyre Pagella` or `newpxtext` if small caps are to be used. The proportions of some of these small caps are off. This is particularly obvious for `o.sc`. Here `O\textsc{o}o` is compared for `newpxtext` with option `largesc`, `TeX Gyre Pagella` and `mathpazo` with option `sc` (or `osf`):
[![ente... |
31,751,206 | I am trying to build a kinesis consumer script using python 3.4 below is an example of my code. I want the records to be saved to a local file that I can later push to S3:
```
from boto import kinesis
import time
import json
# AWS Connection Credentials
aws_access_key = 'your_key'
aws_access_secret = 'your_secret key... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31751206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5178591/"
] | Using `^+` means one (or more consecutive) carat characters. Remove the plus
```
String[] barcodeFields = contents.split("\\^");
```
and it won't *eat* empty fields. You'll get (your requested) `""` for empty fields. | The following results in `[blah, , bladiblah, moarblah]`:
```
String test = "blah^^bladiblah^moarblah";
System.out.println(Arrays.toString(test.split("\\^")));
```
Where the `^^` are replaced by a `""`, the empty String |
31,751,206 | I am trying to build a kinesis consumer script using python 3.4 below is an example of my code. I want the records to be saved to a local file that I can later push to S3:
```
from boto import kinesis
import time
import json
# AWS Connection Credentials
aws_access_key = 'your_key'
aws_access_secret = 'your_secret key... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31751206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5178591/"
] | `String.split` leaves an empty string (`""`) where it encounters consecutive delimiters, as long as you use the right regex. If you want to replace it with `"empty"`, you'd have to do so yourself:
```
String[] split = barcodeFields.split("\\^");
for (int i = 0; i < split.length; ++i) {
if (split[i].length() == 0) ... | Using `^+` means one (or more consecutive) carat characters. Remove the plus
```
String[] barcodeFields = contents.split("\\^");
```
and it won't *eat* empty fields. You'll get (your requested) `""` for empty fields. |
31,751,206 | I am trying to build a kinesis consumer script using python 3.4 below is an example of my code. I want the records to be saved to a local file that I can later push to S3:
```
from boto import kinesis
import time
import json
# AWS Connection Credentials
aws_access_key = 'your_key'
aws_access_secret = 'your_secret key... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31751206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5178591/"
] | The answer by [mureinik](https://stackoverflow.com/users/2422776/mureinik) is quite close, but wrong in an important edge case: when the trailing delimiters are in the end. To account for that you have to use:
```
contents.split("\\^", -1)
```
E.g. look at the following code:
```
final String line = "alpha ^beta ^^... | Using `^+` means one (or more consecutive) carat characters. Remove the plus
```
String[] barcodeFields = contents.split("\\^");
```
and it won't *eat* empty fields. You'll get (your requested) `""` for empty fields. |
31,751,206 | I am trying to build a kinesis consumer script using python 3.4 below is an example of my code. I want the records to be saved to a local file that I can later push to S3:
```
from boto import kinesis
import time
import json
# AWS Connection Credentials
aws_access_key = 'your_key'
aws_access_secret = 'your_secret key... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31751206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5178591/"
] | `String.split` leaves an empty string (`""`) where it encounters consecutive delimiters, as long as you use the right regex. If you want to replace it with `"empty"`, you'd have to do so yourself:
```
String[] split = barcodeFields.split("\\^");
for (int i = 0; i < split.length; ++i) {
if (split[i].length() == 0) ... | The following results in `[blah, , bladiblah, moarblah]`:
```
String test = "blah^^bladiblah^moarblah";
System.out.println(Arrays.toString(test.split("\\^")));
```
Where the `^^` are replaced by a `""`, the empty String |
31,751,206 | I am trying to build a kinesis consumer script using python 3.4 below is an example of my code. I want the records to be saved to a local file that I can later push to S3:
```
from boto import kinesis
import time
import json
# AWS Connection Credentials
aws_access_key = 'your_key'
aws_access_secret = 'your_secret key... | 2015/07/31 | [
"https://Stackoverflow.com/questions/31751206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5178591/"
] | The answer by [mureinik](https://stackoverflow.com/users/2422776/mureinik) is quite close, but wrong in an important edge case: when the trailing delimiters are in the end. To account for that you have to use:
```
contents.split("\\^", -1)
```
E.g. look at the following code:
```
final String line = "alpha ^beta ^^... | The following results in `[blah, , bladiblah, moarblah]`:
```
String test = "blah^^bladiblah^moarblah";
System.out.println(Arrays.toString(test.split("\\^")));
```
Where the `^^` are replaced by a `""`, the empty String |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | **jsfiddle:** <http://jsfiddle.net/mgtoz4d3/>
I added a container which contains both buttons. Try this:
CSS:
```
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
#container{
text-align: center;
}
```
HTML:
```
<img src="kingstonunilogo.jpg" alt="uni logo" style=... | Have both the buttons inside a div as shown below and add the given CSS for that div
```css
#button1, #button2{
width: 200px;
height: 40px;
}
#butn{
margin: 0 auto;
display: block;
}
```
```html
<div id="butn">
<button type="button home-button" id="button1" >Home</button>
<button type="button cont... |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | you can add this style to your buttons:
```
#button1 , #button2 {
display:inline-block;
/* additional code */
}
```
this aligns your buttons inline. ('side by side') :) | **jsfiddle:** <http://jsfiddle.net/mgtoz4d3/>
I added a container which contains both buttons. Try this:
CSS:
```
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
#container{
text-align: center;
}
```
HTML:
```
<img src="kingstonunilogo.jpg" alt="uni logo" style=... |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | **jsfiddle:** <http://jsfiddle.net/mgtoz4d3/>
I added a container which contains both buttons. Try this:
CSS:
```
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
#container{
text-align: center;
}
```
HTML:
```
<img src="kingstonunilogo.jpg" alt="uni logo" style=... | Utilize regular buttons and set the display property to inline in order to center the buttons on a single line. Setting the display property to inline-block will also put them on the same line, but they will not be centered via that display property setting. |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | This can be solved using the following `CSS`:
```
#container {
text-align: center;
}
button {
display: inline-block;
}
```
`display: inline-block` will put the buttons side by side and `text-align: center` places the buttons in the center of the page.
JsFiddle: <https://jsfiddle.net/026tbk13/> | your code will look something like this ...
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
display:inline-block;
</style>
<meta charset="utf-8">
<meta name="Homepage" content="Starting page for the survey website ">
<title> Surve... |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | you can add this style to your buttons:
```
#button1 , #button2 {
display:inline-block;
/* additional code */
}
```
this aligns your buttons inline. ('side by side') :) | ```css
.wrapper{
float: left;
width: 100%;
text-align: center;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.button{
display:inline-block;
}
```
```html
<div class="wrapper">
<button class="button">Button1</button>
<button class="button">Button2</button>
</div>
``` |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | **jsfiddle:** <http://jsfiddle.net/mgtoz4d3/>
I added a container which contains both buttons. Try this:
CSS:
```
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
#container{
text-align: center;
}
```
HTML:
```
<img src="kingstonunilogo.jpg" alt="uni logo" style=... | ```css
.wrapper{
float: left;
width: 100%;
text-align: center;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.button{
display:inline-block;
}
```
```html
<div class="wrapper">
<button class="button">Button1</button>
<button class="button">Button2</button>
</div>
``` |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | you can add this style to your buttons:
```
#button1 , #button2 {
display:inline-block;
/* additional code */
}
```
this aligns your buttons inline. ('side by side') :) | Have both the buttons inside a div as shown below and add the given CSS for that div
```css
#button1, #button2{
width: 200px;
height: 40px;
}
#butn{
margin: 0 auto;
display: block;
}
```
```html
<div id="butn">
<button type="button home-button" id="button1" >Home</button>
<button type="button cont... |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | you can add this style to your buttons:
```
#button1 , #button2 {
display:inline-block;
/* additional code */
}
```
this aligns your buttons inline. ('side by side') :) | Utilize regular buttons and set the display property to inline in order to center the buttons on a single line. Setting the display property to inline-block will also put them on the same line, but they will not be centered via that display property setting. |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | **jsfiddle:** <http://jsfiddle.net/mgtoz4d3/>
I added a container which contains both buttons. Try this:
CSS:
```
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
#container{
text-align: center;
}
```
HTML:
```
<img src="kingstonunilogo.jpg" alt="uni logo" style=... | **jsFiddle:**<http://jsfiddle.net/7Laf8/1302/>
I hope this answers your question.
```css
.wrapper {
text-align: center;
display: inline-block;
position: absolute;
top: 50%;
left: 50%;
}
```
```html
<div class="wrapper">
<button class="button">Hello</button>
<button class="button">Another One</b... |
27,671,709 | I'm trying to position the two buttons next to each other in the center of the page and also make the buttons static as you resize the page.
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
</style>
<meta charset="utf-8">
<meta name=... | 2014/12/27 | [
"https://Stackoverflow.com/questions/27671709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386886/"
] | you can add this style to your buttons:
```
#button1 , #button2 {
display:inline-block;
/* additional code */
}
```
this aligns your buttons inline. ('side by side') :) | your code will look something like this ...
```
<!doctype html>
<html lang="en">
<head>
<style>
#button1{
width: 300px;
height: 40px;
}
#button2{
width: 300px;
height: 40px;
}
display:inline-block;
</style>
<meta charset="utf-8">
<meta name="Homepage" content="Starting page for the survey website ">
<title> Surve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.