qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
19,967,558 | I was wondering if anyone knew if it where possible to dynamically display an image through code pulling it straight from the res folder in eclipse for a droid app without setting up an imageview in the xml file.
I'm still fairly new to droid and programming in general and so far all images I have ever displayed I ha... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19967558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1091368/"
] | LinearLayout linear=new LinearLayout(getApplicationContext());
ImageView img=new ImageView(getApplicationContext());
img.setBackgroundResource(R.drawable.ic\_launcher);
linear.addView(img);
setContentView(linear); | you can inflate views from Java code using their Java object equivalents. For ImageView:
```
ImageView imageView = new ImageView(Context);
imageView.setImageDrawable(getResources().getDrawable(R.drawable.image_drawable);
addChildView(imageView); // add it to the screen. if in a fragment, need getView().addChildView(im... |
19,967,558 | I was wondering if anyone knew if it where possible to dynamically display an image through code pulling it straight from the res folder in eclipse for a droid app without setting up an imageview in the xml file.
I'm still fairly new to droid and programming in general and so far all images I have ever displayed I ha... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19967558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1091368/"
] | LinearLayout linear=new LinearLayout(getApplicationContext());
ImageView img=new ImageView(getApplicationContext());
img.setBackgroundResource(R.drawable.ic\_launcher);
linear.addView(img);
setContentView(linear); | 1.In xml layout, add id to default layout as **android:id="@+id/layout"**
2.Now in java file :
RelativeLayout layout =(RelativeLayout)findViewById(R.id.**layout**); //xml default layout
LinearLayout linear1 = new LinearLayout(getApplicationContext()); //dynamically created layout
linear1.setBackgroundResource(R.dr... |
13,636,397 | Is the following guaranteed to work or implementation defined?
```
unsigned int a = 4294967294;
signed int b = a;
```
The value of `b` is `-2` on gcc.
>
> From C99
> (§6.3.1.3/3) Otherwise, the new type is signed and the value cannot be
> represented in it; either the result is implementation-defined or an
> im... | 2012/11/29 | [
"https://Stackoverflow.com/questions/13636397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/255412/"
] | The conversion of `a` value to `signed int` is implementation-defined (as you correctly mentioned because of 6.3.1.3p3) . On some systems for example it can be `INT_MAX` (saturating conversion).
For `gcc` the implementation behavior is defined here:
>
> *The result of, or the signal raised by, converting an integer ... | @ouah's answer tells you that its implementation-defined, but doesn't explain how your implementation yields (-2) specifically. I'll answer that:
1) Your implementation seems to have 32-bit wide int type and 2's complement representation.
2) 4294967294 is (UINT\_MAX - 1) = 0xfffffffe.
In your implementation, (UINT\_... |
36,410,945 | I am having some trouble loading relationship data using Ember 2.0. Given the following two models, Project and LineItem, I am trying to list all line items belonging to a given project:
```
export default DS.Model.extend({
name: DS.attr(),
organisation: DS.attr(),
customer: DS.attr(),
hours: DS.attr({... | 2016/04/04 | [
"https://Stackoverflow.com/questions/36410945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1796218/"
] | I tested your code and yep, it is not working. It works only if I rename the model "item" and "items" everywhere. It looks to me, that Ember Data doesn't like concatenated model names...
So, as a conclusion, we should use simple name everywhere, or have to figure out the exact syntax... camelCase, dash-erized or under... | I would suggest to do following:
Load the project in your route as you do it now.
Pass the project instance into the component instead of injecting store instance.
```
// template which gets rendered after model() hook
...
{{#if model}}
{{!-- pass the model into your component as 'project' --}}
{{your-component p... |
53,060,609 | When I run my unit tests in the android studio with code coverage and select to see the source from the Coverage toolbar, I cannot see the code coverage information in the gutter(sidebar) of the editor as shown [here](https://www.jetbrains.com/help/idea/2018.1/viewing-code-coverage-results.html). There is no informatio... | 2018/10/30 | [
"https://Stackoverflow.com/questions/53060609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6341943/"
] | <http://tutorials.webtecho.com/code-coverage-in-android-studio/>
Go to configuration -> Unit test , click the drop down then click the project module you would like to enable coverage on then click code coverage and enable tracing . Also click on Analyze then Show code coverage data . | 1. Run tests with Code coverage
2. Go to that class you write a test for
3. You can see the coverage indication on gutter |
64,709,569 | I have a Postgresql DB with a total size of 1.7TB. Out of which 1.6TB is occupied by one table. The total disk space was 1.7TB so I am now out of Disk space.
I cannot run Vacuum on it, I tried truncating few tables and then used the available space to run Vacuum o the other tables and was able to get some space. But t... | 2020/11/06 | [
"https://Stackoverflow.com/questions/64709569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6261178/"
] | Kivy module will read and parse the \*.kv file automatically if the \*.kv file name matches your app class name.
Example 1: if your app class is like this:
```py
class MyApp(App):
pass
```
The \*.kv file that kivy module will be looing for: `my.kv`
Example 2: if your app class is like this:
```py
class SomeAp... | Install kivy package in your system
```
from kivy.lang.builder import Builder
Builder.load_string(
<Enter kv code here>
)
```
try this |
23,140,736 | I tried using a table and found it fun because it makes it a lot easier for me to organize contents easily rather than just using plain divs;however, now my form won't work and I am not sure what is the problem.
HTML:
```
<?php
include('connect.php');
?>
<div class="signUpWrapper">
<h1 class="con... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23140736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3520494/"
] | I would use a regular Button styled to have no UI, and would pass the `ViewModel` to it using the `CommandParameter`
For example,
```
<ControlTemplate x:Key="ContentOnlyTemplate" TargetType="{x:Type Button}">
<ContentPresenter />
</ControlTemplate>
...
<ItemsControl.ItemTemplate>
<DataTemplate>
<Bu... | Any reason why it is a `StackPanel` yet you want something to know if it is `Clicked`?
I suggest you to change it to a `Button` and change the `Template` for it then hookup the `Command` property to a property in your `ViewModel` then said the `CommandParamter` as the `Type` |
13,494,898 | I have a widget that parses xml feed and display its title and image.In this widget I am using a service that periodically changes the contents(ie, title and image).For this I am using timer class.When we run this widget, some contents are displayed without any problem but after sometime it force closes and shows an er... | 2012/11/21 | [
"https://Stackoverflow.com/questions/13494898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1302978/"
] | I just solved a similar problem.
But I wasn't loading any content from web.
My widget was displaying different images for different widget sizes. And for some screens there was the same error as yours displaying widget 4x4.
That what I've found at developer.google.com:
>
> The total Bitmap memory used by the RemoteV... | To demonstrate the second part of RusArtM response
```
val bitmapOptions = BitmapFactory.Options()
bitmapOptions.inSampleSize = 4
val bitmap = BitmapFactory.decodeFile(codeData.imagePath, bitmapOptions)
```
Should probably solve the issue. `inSampleSize` with a value superior to one, shrink the image. With an `inSam... |
13,494,898 | I have a widget that parses xml feed and display its title and image.In this widget I am using a service that periodically changes the contents(ie, title and image).For this I am using timer class.When we run this widget, some contents are displayed without any problem but after sometime it force closes and shows an er... | 2012/11/21 | [
"https://Stackoverflow.com/questions/13494898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1302978/"
] | I just solved a similar problem.
But I wasn't loading any content from web.
My widget was displaying different images for different widget sizes. And for some screens there was the same error as yours displaying widget 4x4.
That what I've found at developer.google.com:
>
> The total Bitmap memory used by the RemoteV... | Google invented a funny picture cache. I do not know why, but it greatly increases the load on the system. That's why I do it every time and don't store the picture history:
```
contentView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.notification_media);
Intent notify = new Int... |
10,354,025 | I'm trying to make my application listen to incoming text messages, in a persistent manner. What would be the best approach for this?
Currently, I've got a working BroadcastReceiver and I'm playing around with implementing a local service for my app. Is somehow implementing the BroadcastReceiver into the service the c... | 2012/04/27 | [
"https://Stackoverflow.com/questions/10354025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/678413/"
] | Yes broadcast receiver is best way for listening to incoming texts.if an incoming sms recvied use IntentService for your work what u want to do on sms recived.u can register a reciver for incoming sms as:
**manifest file**
```
<receiver class="SMSApp">
<intent-filter>
<action android:value="android.provi... | The broadcast receiver does not need your application to be started, hence is the correct way of listening to incoming texts.
Just make sure to register it in the Manifest |
36,355,206 | I am creating a REST API and I have, for example, Authors and Posts.
So I can get the posts published by an author with:
```
/authors/123/posts
```
Or
```
/posts?authorId=123
```
I think building a flexible API might be a better option. To get posts by author I would do:
```
/posts?authorId=123&published=true&... | 2016/04/01 | [
"https://Stackoverflow.com/questions/36355206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577805/"
] | There is a **myth** that each resource **must have only one path**. Both of your examples are correct.
With your first example:
`/authors/123/posts`.
It makes sense when there is a **hierarchical relationship** between the two, if your current context is an `author`, it's no problem accessing posts of that author.
... | The rule of thumb we use on our projects: use a url path, e.g. `/authors/123/posts` if there is a clear hierarchical relationship between the two, and the resource you're visiting cannot live outside the context of the other one. For example, when retrieving order lines, it is straightforward to use `/orders/123/lines`... |
15,562,417 | My app needs to support iOS version >= 5.0.1. I can't support <= 5.0 because I need to set the "Don't BackUp" flag for the data downloaded!
How do I set the minimum iOS version required to 5.0.1? | 2013/03/22 | [
"https://Stackoverflow.com/questions/15562417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2109713/"
] | That flag was introduced in iOS 5.1, so you'll have to change your deployment target to 5.1 to be able to do that. | Use it:
* Double-click on your Target's name in Xcode to bring up the Target Info.
* Go to the Build/Summary tab and search for "iPhone OS Deployment Target".
* Pick whichever SDK you want to use as your minimum requirements.
One thing is that it won't tell you if it doesn't work on a certain version. You'll have to ... |
10,702,825 | I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
```
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
```
when use **PartialView("ListItem")** this is correctly works. But i need to put partialviews in sub folder... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10702825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60200/"
] | check the value of: HttpContext.GetOverriddenBrowser().IsMobileDevice | I believe MS wants you to use [this](http://msdn.microsoft.com/en-us/library/system.web.mvc.controllercontext.displaymode%28v=vs.108%29.aspx):
```
controller.ControllerContext.DisplayMode
```
It works but I found two major problem with it (as of the date of this post):
1. Unit testing. DisplayMode property can not ... |
10,702,825 | I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
```
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
```
when use **PartialView("ListItem")** this is correctly works. But i need to put partialviews in sub folder... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10702825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60200/"
] | check the value of: HttpContext.GetOverriddenBrowser().IsMobileDevice | The best option you have is checking the Request headers user agent field where you can listen for android iPhone etc. While that wont give you screen size and isnt going to work if you are not listening for nokia phones or something like that, this is a solution and allows you to limit what you support as most compani... |
10,702,825 | I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
```
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
```
when use **PartialView("ListItem")** this is correctly works. But i need to put partialviews in sub folder... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10702825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60200/"
] | I also needed to access the current display mode so I could adjust the view model that was passed to the view (less information in the mobile view thus it can be displayed from a smaller view model).
`ControllerContext.DisplayMode` cannot be used because it will be set after the action has executed.
So you have to de... | check the value of: HttpContext.GetOverriddenBrowser().IsMobileDevice |
10,702,825 | I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
```
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
```
when use **PartialView("ListItem")** this is correctly works. But i need to put partialviews in sub folder... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10702825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60200/"
] | I also needed to access the current display mode so I could adjust the view model that was passed to the view (less information in the mobile view thus it can be displayed from a smaller view model).
`ControllerContext.DisplayMode` cannot be used because it will be set after the action has executed.
So you have to de... | I believe MS wants you to use [this](http://msdn.microsoft.com/en-us/library/system.web.mvc.controllercontext.displaymode%28v=vs.108%29.aspx):
```
controller.ControllerContext.DisplayMode
```
It works but I found two major problem with it (as of the date of this post):
1. Unit testing. DisplayMode property can not ... |
10,702,825 | I'm developing mobile web application. I need to get current displaymode is mobile in controller.
My problem is: I have 2 partialview
```
/Views/Shared/ListItem.cshtml
/Views/Shared/ListItem.mobile.cshtml
```
when use **PartialView("ListItem")** this is correctly works. But i need to put partialviews in sub folder... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10702825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60200/"
] | I also needed to access the current display mode so I could adjust the view model that was passed to the view (less information in the mobile view thus it can be displayed from a smaller view model).
`ControllerContext.DisplayMode` cannot be used because it will be set after the action has executed.
So you have to de... | The best option you have is checking the Request headers user agent field where you can listen for android iPhone etc. While that wont give you screen size and isnt going to work if you are not listening for nokia phones or something like that, this is a solution and allows you to limit what you support as most compani... |
2,258,988 | Thanks for reading.
I'm using Unity framework to implement dependency injection in my app (ASP.Net MVC).
Sometimes there are some cyclic dependencies among services that I want to avoid.
So I'm looking for solutions : )
---
**My case**
-----------
well lets imagine 3 services ServiceSally, ServiceJoe, ServiceJudy
... | 2010/02/13 | [
"https://Stackoverflow.com/questions/2258988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201142/"
] | This depends on what (if any) DI framework you're using. [Spring](http://www.springsource.org/) for example will handle this kind of cyclic dependency as long as not every involved bean (object) is initialized by a constructor. Basically it injects an empty object into (at least) one of the other beans and initializes ... | Don't make a Service\* dependent on another concrete Service\*. Make them dependent on a superclass or interface. Then inject a concrete Service\* into another Service\* after creation. |
2,258,988 | Thanks for reading.
I'm using Unity framework to implement dependency injection in my app (ASP.Net MVC).
Sometimes there are some cyclic dependencies among services that I want to avoid.
So I'm looking for solutions : )
---
**My case**
-----------
well lets imagine 3 services ServiceSally, ServiceJoe, ServiceJudy
... | 2010/02/13 | [
"https://Stackoverflow.com/questions/2258988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201142/"
] | This depends on what (if any) DI framework you're using. [Spring](http://www.springsource.org/) for example will handle this kind of cyclic dependency as long as not every involved bean (object) is initialized by a constructor. Basically it injects an empty object into (at least) one of the other beans and initializes ... | I agree with Cletus to some extend, whenever you find yourself having services depend on one another it's time to sit down and rethink your design.
If you do "lazy DI", why are you doing DI at all? One of the benefits of using DI is not having to worry when your dependencies are initialized, you just have them there w... |
2,258,988 | Thanks for reading.
I'm using Unity framework to implement dependency injection in my app (ASP.Net MVC).
Sometimes there are some cyclic dependencies among services that I want to avoid.
So I'm looking for solutions : )
---
**My case**
-----------
well lets imagine 3 services ServiceSally, ServiceJoe, ServiceJudy
... | 2010/02/13 | [
"https://Stackoverflow.com/questions/2258988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201142/"
] | Don't make a Service\* dependent on another concrete Service\*. Make them dependent on a superclass or interface. Then inject a concrete Service\* into another Service\* after creation. | I agree with Cletus to some extend, whenever you find yourself having services depend on one another it's time to sit down and rethink your design.
If you do "lazy DI", why are you doing DI at all? One of the benefits of using DI is not having to worry when your dependencies are initialized, you just have them there w... |
55,026,478 | I have the following code with a variadic template copied from:
<https://www.youtube.com/watch?v=iWvcoIKSaoc> @41:30
```
auto sum() { return 0; }
template<typename Head, typename... Tail>
auto sum(Head head, Tail... tail)
{
return head+sum(tail...);
}
int main() {
cout<< sum(1,2.4) << endl;
//cout<< su... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55026478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2851232/"
] | The trick is to never allow empty `sum()` calls, and treat the `sum(last)` as the last recursion:
```
template<typename Last>
auto sum(Last last) {
return last;
}
template<typename Head, typename Second, typename... Tail>
auto sum(Head head, Second second, Tail... tail)
{
return head + sum(second, tail...);
}... | >
> 1. The `sum()` function is required here so that I can have a return value for a `void` passed in when processing the last variadic member - Is it possible to avoid writing this `sum()` function and have the same functionality?
>
>
>
Every recursion needs a stop condition. In the typical use of recursion with ... |
55,026,478 | I have the following code with a variadic template copied from:
<https://www.youtube.com/watch?v=iWvcoIKSaoc> @41:30
```
auto sum() { return 0; }
template<typename Head, typename... Tail>
auto sum(Head head, Tail... tail)
{
return head+sum(tail...);
}
int main() {
cout<< sum(1,2.4) << endl;
//cout<< su... | 2019/03/06 | [
"https://Stackoverflow.com/questions/55026478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2851232/"
] | To complement @GuillaumeRacicot answer I prefer to end a recursion with `if constexpr` which is a `c++17` feature.
```
template<typename Head, typename Second, typename... Tail>
auto sum(Head head, Second second, Tail... tail)
{
if constexpr(sizeof...(tail) > 0)
return head + sum(second, tail...);
retur... | >
> 1. The `sum()` function is required here so that I can have a return value for a `void` passed in when processing the last variadic member - Is it possible to avoid writing this `sum()` function and have the same functionality?
>
>
>
Every recursion needs a stop condition. In the typical use of recursion with ... |
26,517,641 | I managed to save a new password or change a password for a logged in user.
```
public function saveNewPassword() {
$rules = array(
'old_password' => 'required',
'password' => 'required|confirmed|different:old_password',
'password_confirmation' => 'required|different:o... | 2014/10/22 | [
"https://Stackoverflow.com/questions/26517641",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/736018/"
] | I use this sollution for changing the password. In your rules you have one error: password\_confirmation should be the same as password not password\_confirmation.
Here is the complete and tested function:
```
public function changePassword($id){
$rules = array(
'old_password' => 'require... | From the github of confide:
Integrated with the Laravel Auth and Reminders component/configs.
So I would guess using the `Auth::validate()` method will do the trick. |
3,561 | I have problem with wget behavior for 1.10 and later versions.
I am using wget to download a report from my app.
**version 1.10.2:**
```
>wget-1.10.2.exe --http-user=trader --http-passwd=trader http://192.168.1.222:8080/myapp/reports/FP201010271100
--11:52:46-- http://192.168.1.222:8080/myapp/reports/FP20101027110... | 2010/10/27 | [
"https://unix.stackexchange.com/questions/3561",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/2156/"
] | Just add `--auth-no-challenge` parameter.
>
> If this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests, just like Wget 1.10.2 and prior did by default.
>
>
>
For details read [bug-description](http://bugs.gentoo.org/show_bug.cgi?id=221043) | I just checked with wget 1.12 here on my machine and your parameters are fine. The output looks as if the server sends different data to both processes though:
The first directly gives you "200" (as in everything is fine) the second sends a "302" meaning redirect. The page it redirects to (http://192.168.1.222:8080/my... |
17,007,177 | Please forgive me if I use improper terminology or sound like a complete noob.
When calling a sub in a class library, I'd like to pass not an instantiated form, but just a reference to the class that represents the form. Then I want to instantiate the form from within the class library function. Is this possible?
Som... | 2013/06/09 | [
"https://Stackoverflow.com/questions/17007177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2467711/"
] | Additionally to MotoSV's answer, here is a version that uses only generics:
```
Public Shared Sub DisplayForm(Of T As {New, Form})()
Dim instance = New T()
instance.ShowDialog()
End Sub
```
Which you can use like:
```
DisplayForm(Of Form1)()
```
With this approach you can be sure that the passed type is a... | Try
```
Dim classType As Type = GetType(Form1)
```
Then call the method:
```
DisplayForm(classType)
```
You can then use this type information and reflection to create an instance at runtime in the DisplayForm method:
```
Activator.CreateInstance(classType)
```
Note that this is a simple example and performs n... |
26,899,785 | So my problem is that I have a class called `GeometricFigure2` which holds fields such as `width` and `height`. I have an interface called `SidedObject` which holds a method to display how many sides a figure has
```
public interface SidedObject
{
public void displaySides();
}
```
I have two subclasses called `S... | 2014/11/13 | [
"https://Stackoverflow.com/questions/26899785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4246222/"
] | You have three choices:
1. Have `GeometricFigure2` implement your `SidedObject` interface.
2. Declare your array as type `SidedObject[]` instead of `GeometricFigure2[]`.
3. Cast your array variables to `SidedObject`:
`((SidedObject) geoRef[i]).displaySides();` | For the `displaySides()` method from `SideObject` to work with instances of `GeometricFigure2` you would need to modify `GeometricFigure2` to implement `SidedObject`. |
4,096 | Miller, in his translation of Seneca, makes Chaos masculine:
>
> "let Chaos re-echo the outcries of his grief."
>
> Source: [Hercules Furens, trans. Frank Justus Miller, ~1100](http://www.theoi.com/Text/SenecaHerculesFurens.html)
>
>
>
Here is a link to the Latin on Perseus:
>
> Resonet maesto clamore chaos ... | 2017/04/14 | [
"https://latin.stackexchange.com/questions/4096",
"https://latin.stackexchange.com",
"https://latin.stackexchange.com/users/1407/"
] | Doubtful. In 860 of the same play, we get:
>
> stat chaos densum tenebraeque turpes
>
>
>
Chaos here is neuter (because of *densum*). Lewis and Short says that Chaos is masculine when personified as a god rather than as the underworld or the formless, primordial matter, but I don't see that in the OLD, and none o... | The adjective *maesto* determines the noun *clamore* and is therefore in a masculine form.
The corresponding neuter form is also *maesto*.
The thing that reveals the connection to *clamore* is case: both *maesto* and *clamore* are in ablative, whereas *chaos* is nominative (the subject of the clause).
This literal tra... |
4,096 | Miller, in his translation of Seneca, makes Chaos masculine:
>
> "let Chaos re-echo the outcries of his grief."
>
> Source: [Hercules Furens, trans. Frank Justus Miller, ~1100](http://www.theoi.com/Text/SenecaHerculesFurens.html)
>
>
>
Here is a link to the Latin on Perseus:
>
> Resonet maesto clamore chaos ... | 2017/04/14 | [
"https://latin.stackexchange.com/questions/4096",
"https://latin.stackexchange.com",
"https://latin.stackexchange.com/users/1407/"
] | Doubtful. In 860 of the same play, we get:
>
> stat chaos densum tenebraeque turpes
>
>
>
Chaos here is neuter (because of *densum*). Lewis and Short says that Chaos is masculine when personified as a god rather than as the underworld or the formless, primordial matter, but I don't see that in the OLD, and none o... | Indeed, the Greek borrowing was mostly used an a neuter noun in Latin but occasionally we see examples of chaos used as a masculine noun (one source claims that there is only one use of chaos in Latin as a masculine noun - Vetus Latina Luca 16.26 but I couldn't verify this). We need to look it up in TLL.
Quite often, ... |
41,205,299 | OK this is kind of 2 questions in one, so be prepare for some abstract stuff.
I'm trying to find out of 2 tables (Dep1 and Dep2) that are connected to Employees, which may have different positions with associated salaries (for the sake of simplicity lets assume there are no associative tables in between them even thou... | 2016/12/18 | [
"https://Stackoverflow.com/questions/41205299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7117502/"
] | try this
```
[Serializable()]
public class User
{
public string Fname { get; set; }
public string Lname { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public int Zip { get; set; }
... | To be able to serialize / deserialize a class, the serializer requires a parameterless constructor. So, you need to add the parameterless constructors only to your classes
```
public class User
{
public string Fname { get; set; }
public string Lname { get; set; }
public string Address {... |
42,855,859 | I have an ArrayList of ArrayLists of words where Word is a class.
```
ArrayList<ArrayList<Word>> arrayColumns = new ArrayList();
```
with every new column I have to create a new ArrayList of Words and then add that to arrayColumns.
This ArrayList I am creating dynamically and want to name it as arrayWordColumn1, a... | 2017/03/17 | [
"https://Stackoverflow.com/questions/42855859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5718184/"
] | Probably like this
```
Map<String,List<Word>> map = new HashMap();
map.put("arrayWordColumn1", list);
``` | you can use this stucture :
ArrayList < Map > i think that's better
ArrayList of Map that has Integer Key and list of word is better in the access when you add a new list of word you should use new Integer(value)
good luck |
42,855,859 | I have an ArrayList of ArrayLists of words where Word is a class.
```
ArrayList<ArrayList<Word>> arrayColumns = new ArrayList();
```
with every new column I have to create a new ArrayList of Words and then add that to arrayColumns.
This ArrayList I am creating dynamically and want to name it as arrayWordColumn1, a... | 2017/03/17 | [
"https://Stackoverflow.com/questions/42855859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5718184/"
] | Probably like this
```
Map<String,List<Word>> map = new HashMap();
map.put("arrayWordColumn1", list);
``` | You can get the names of the variables at runtime. After getting these variable names, you can create references by using Map or any other structure, you want.
[how to get variable names at runtime](http://openjdk.java.net/jeps/118)
The summary of this is given as follows;
>
> Provide a mechanism to easily and re... |
42,855,859 | I have an ArrayList of ArrayLists of words where Word is a class.
```
ArrayList<ArrayList<Word>> arrayColumns = new ArrayList();
```
with every new column I have to create a new ArrayList of Words and then add that to arrayColumns.
This ArrayList I am creating dynamically and want to name it as arrayWordColumn1, a... | 2017/03/17 | [
"https://Stackoverflow.com/questions/42855859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5718184/"
] | Declare a map string, list
```
Map<String,List<Word>> myDynamicMap = new HashMap<>();
```
to add dynamic variables:
```
myDynamicMap.put("ListWord_1", list1);
myDynamicMap.put("ListWord_2", someList);
myDynamicMap.put("ListWord_3", anotherList);
```
to get a list from the map:
```
myDynamicMap.get("ListWord_3");... | you can use this stucture :
ArrayList < Map > i think that's better
ArrayList of Map that has Integer Key and list of word is better in the access when you add a new list of word you should use new Integer(value)
good luck |
42,855,859 | I have an ArrayList of ArrayLists of words where Word is a class.
```
ArrayList<ArrayList<Word>> arrayColumns = new ArrayList();
```
with every new column I have to create a new ArrayList of Words and then add that to arrayColumns.
This ArrayList I am creating dynamically and want to name it as arrayWordColumn1, a... | 2017/03/17 | [
"https://Stackoverflow.com/questions/42855859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5718184/"
] | Declare a map string, list
```
Map<String,List<Word>> myDynamicMap = new HashMap<>();
```
to add dynamic variables:
```
myDynamicMap.put("ListWord_1", list1);
myDynamicMap.put("ListWord_2", someList);
myDynamicMap.put("ListWord_3", anotherList);
```
to get a list from the map:
```
myDynamicMap.get("ListWord_3");... | You can get the names of the variables at runtime. After getting these variable names, you can create references by using Map or any other structure, you want.
[how to get variable names at runtime](http://openjdk.java.net/jeps/118)
The summary of this is given as follows;
>
> Provide a mechanism to easily and re... |
71,734,138 | I have an enum as follows. I also have a string `in-progress` I am trying to parse this string to the appropriate enum. As seen by the following test we want to parse to take a string and return the enum
```
[Fact]
public void TestParseOfEnum()
{
var data = "not-started";
var parsed = Enum... | 2022/04/04 | [
"https://Stackoverflow.com/questions/71734138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1841839/"
] | You can try with a extension method to read the Custom Atribute from Enums:
```
public static class EnumExtensions
{
public static T GetValueFromEnumMember<T>(string value) where T: Enum
{
var type = typeof(T);
foreach (var field in type.GetFields())
{
var attribute = Attrib... | >
> I tried something like this but Literal doesn't exist at this point apparently so this fails as well.
>
>
>
One error in your question is that you're calling `GetCustomAttributes` rather than `GetCustomAttribute`. `GetCustomAttributes` returns an `IEnumerable<EnumLiteralAttribute>`, which won't of course have ... |
71,734,138 | I have an enum as follows. I also have a string `in-progress` I am trying to parse this string to the appropriate enum. As seen by the following test we want to parse to take a string and return the enum
```
[Fact]
public void TestParseOfEnum()
{
var data = "not-started";
var parsed = Enum... | 2022/04/04 | [
"https://Stackoverflow.com/questions/71734138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1841839/"
] | You can try with a extension method to read the Custom Atribute from Enums:
```
public static class EnumExtensions
{
public static T GetValueFromEnumMember<T>(string value) where T: Enum
{
var type = typeof(T);
foreach (var field in type.GetFields())
{
var attribute = Attrib... | you can use this:
```
var enumType = typeof(CarePlanActivityStatus);
FieldInfo field = enumType.GetField(nameof(CarePlanActivityStatus.Cancelled));
var enumLiteralAttribute = field.GetCustomAttribute<EnumLiteralAttribute>(false);
WriteLine(enumLiteralAttribute.Name); // canceled
WriteLine(enumLiteralAttribute.Url); //... |
71,734,138 | I have an enum as follows. I also have a string `in-progress` I am trying to parse this string to the appropriate enum. As seen by the following test we want to parse to take a string and return the enum
```
[Fact]
public void TestParseOfEnum()
{
var data = "not-started";
var parsed = Enum... | 2022/04/04 | [
"https://Stackoverflow.com/questions/71734138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1841839/"
] | >
> I tried something like this but Literal doesn't exist at this point apparently so this fails as well.
>
>
>
One error in your question is that you're calling `GetCustomAttributes` rather than `GetCustomAttribute`. `GetCustomAttributes` returns an `IEnumerable<EnumLiteralAttribute>`, which won't of course have ... | you can use this:
```
var enumType = typeof(CarePlanActivityStatus);
FieldInfo field = enumType.GetField(nameof(CarePlanActivityStatus.Cancelled));
var enumLiteralAttribute = field.GetCustomAttribute<EnumLiteralAttribute>(false);
WriteLine(enumLiteralAttribute.Name); // canceled
WriteLine(enumLiteralAttribute.Url); //... |
33,966 | My girlfriend from Chile will be coming to USA in end of this year, and I want to take care of the ticket myself, by buying from Delta, for example (with or without using frequent flier points).
What do I need to purchase her ticket here from Santiago to Atlanta (round trip)? Do I simply specify all her information (n... | 2014/07/16 | [
"https://travel.stackexchange.com/questions/33966",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/10258/"
] | I was on the receiving end of such a ticket once, when I was invited to a conference in the US. In my case it was a European carrier (Lufthansa), but paid to their US office. In general it was not different from other bookings, where I made the booking myself. I got the same booking confirmations. However, when I tried... | Me and my friends have done that several times. One of my friends regularly uses a ticket which her father buys from Oman to the US to travel to and fro from the US i.e for a flight originating in the US but the ticket is bought in Oman by a different person (a family member in this case).
I have done the opposite sev... |
14,750,005 | **I have a question I'm hoping you could help with?**
I have two text files containing the following:
**FILE1.txt**
```
http://www.dog.com/
http://www.cat.com/
http://www.antelope.com/
```
**FILE2.txt**
```
1
2
Barry
```
**The output I correctly achieve is as follows:**
```
http://www.dog.com/1
http://www.dog.... | 2013/02/07 | [
"https://Stackoverflow.com/questions/14750005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1617711/"
] | You should use a hash for this. I'd change your input code to make a more complex data structure, as this makes the task easier.
```
open my $animalUrls, '<', 'FILE1.txt' or die "Can't open: $!";
open my $directory, '<', 'FILE2.txt' or die "Can't open: $!";
my @directory = <$directory>; #each line of the file into ... | This code seems to do what you need. It stores all the URLs in `@urls` and prints the content lengths as it fetches each URL. I don't know what you need the length data for afterwards, but I have stored the lengths of each response in the hash `%lengths` to associate them with the URLs.
```
use 5.010;
use warnings;
u... |
52,523,287 | Need to create a circle image that has the user's initials centered within the circle. Similar to how circle icons appear in Gmail. Any third-party component recommendations would be great. | 2018/09/26 | [
"https://Stackoverflow.com/questions/52523287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/756630/"
] | I [found some Swift code](https://github.com/claudot/Swift-UIImageView-Letters/blob/master/Classes/UIImageView%2BLetters.swift) that does exactly what I need. Just had to convert it all to C#.
```
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Globalizat... | It's really simple, i'm giving u a little, not complete, piece of code.
>
> UIView yourview = new UIView(new CGRect(0, 0, 100, 100));
>
>
> yourview.Layer.CornerRadius = 50f;
>
>
>
this will create a view rounded, then u have to add the initials centerd in the box
>
> UILabel yourlabel = new UILabel(new CGRec... |
50,646,491 | For the below code snippet :
```
int a=printf("made,%d,easy",printf("Lucknow"));
printf("%d",a);
```
I am getting the value of a as 11 using GCC Compiler, I am not getting the logic behind this, `printf` returns the number of characters printed on the screen, so it prints `lucknowmade,7,easy`. Therefore, we have 18 ... | 2018/06/01 | [
"https://Stackoverflow.com/questions/50646491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2559674/"
] | The code first executes `printf("Lucknow")` which prints "Lucknow" on the screen and returns the value 7 to the second `printf()` call. The second `printf()` prints "made,7,easy" and returns 11 which is the number of characters it printed. It doesn't know or care what the other function did. | As you have stated, `printf` returns the number of characters printed.
```
printf("made,%d,easy",printf("Lucknow"))
```
returns 11 because `printf("Lucknow")` prints "Lucknow" then returns 7, and so you would end up printing "made,7,easy" which is 11 characters. |
51,498,443 | If I have two lists:
First list => `[1,2,3]`
Second List => `[3,4,5]`
I want this to return true because they both contain `3`? If `3` was replaced by `6` it would return false because no elements would match.
Current Attempt
```
Enum.member?(first_list, fn(x) -> x == second_list end)
```
Ecto queries:
```
us... | 2018/07/24 | [
"https://Stackoverflow.com/questions/51498443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5650878/"
] | Use `Enum.any?/2` with the `in` operator (which is just a shorter form of calling `Enum.member?/2`):
```
iex(1)> xs = [1, 2, 3]
[1, 2, 3]
iex(2)> ys = [3, 4, 5]
[3, 4, 5]
iex(3)> Enum.any?(xs, fn x -> x in ys end)
true
``` | You might get in intersection in the first place, and then validate whether it’s empty or not:
```
case for i <- [1,2,3], i in [3,4,5], do: i do
[] -> false
[_|_] -> true
end
``` |
51,498,443 | If I have two lists:
First list => `[1,2,3]`
Second List => `[3,4,5]`
I want this to return true because they both contain `3`? If `3` was replaced by `6` it would return false because no elements would match.
Current Attempt
```
Enum.member?(first_list, fn(x) -> x == second_list end)
```
Ecto queries:
```
us... | 2018/07/24 | [
"https://Stackoverflow.com/questions/51498443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5650878/"
] | Use `Enum.any?/2` with the `in` operator (which is just a shorter form of calling `Enum.member?/2`):
```
iex(1)> xs = [1, 2, 3]
[1, 2, 3]
iex(2)> ys = [3, 4, 5]
[3, 4, 5]
iex(3)> Enum.any?(xs, fn x -> x in ys end)
true
``` | If lists are large then you can use `MapSet` to check if these lists are disjoint:
```
iex(1)> xs = [1, 2, 3]
[1, 2, 3]
iex(2)> ys = [3, 4, 5]
[3, 4, 5]
iex(3)> not MapSet.disjoint?(MapSet.new(xs), MapSet.new(ys))
true
```
And if you want to know what is the intersection (elements that are common in both sets) then ... |
51,498,443 | If I have two lists:
First list => `[1,2,3]`
Second List => `[3,4,5]`
I want this to return true because they both contain `3`? If `3` was replaced by `6` it would return false because no elements would match.
Current Attempt
```
Enum.member?(first_list, fn(x) -> x == second_list end)
```
Ecto queries:
```
us... | 2018/07/24 | [
"https://Stackoverflow.com/questions/51498443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5650878/"
] | If lists are large then you can use `MapSet` to check if these lists are disjoint:
```
iex(1)> xs = [1, 2, 3]
[1, 2, 3]
iex(2)> ys = [3, 4, 5]
[3, 4, 5]
iex(3)> not MapSet.disjoint?(MapSet.new(xs), MapSet.new(ys))
true
```
And if you want to know what is the intersection (elements that are common in both sets) then ... | You might get in intersection in the first place, and then validate whether it’s empty or not:
```
case for i <- [1,2,3], i in [3,4,5], do: i do
[] -> false
[_|_] -> true
end
``` |
58,219,816 | In Vaadin 14, I would like to have a listbox with a scrollbar. Either permanently present, or even better, one that appears when the space needed for the list exceeds the maximum height of the listbox.
It does not necessarily have to be done using the vaadin core component; if there is something else out there that wou... | 2019/10/03 | [
"https://Stackoverflow.com/questions/58219816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5226427/"
] | This is how a [ListBox](https://vaadin.com/components/vaadin-list-box) component already works in Vaadin :) Scrollbar appears, if there is no enough space to display all items
```java
ListBox<String> listBox = new ListBox<>();
listBox.setItems("Bread", "Butter", "Milk");
listBox.setHeight("100px");
add(listBox);
```... | Setting height will work, and with minor CSS changes max-height will also work. Here’s what you need to add to your theme.
In Java (Vaadin 14+):
```java
@CssImport(value = "./styles/my-styles.css", themeFor = "vaadin-list-box")
```
In CSS (my-styles.css):
```css
[part="items"] {
flex: auto;
height: auto;
}
``... |
54,359,085 | I want to remove all the newlines/extra lines when I save the code. I found this settings in Atom but not in VSCode. How can I do that? | 2019/01/25 | [
"https://Stackoverflow.com/questions/54359085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10744738/"
] | You can set the VSCode setting `html.format.preserveNewLines` to `false`. It will be recognized by Beautify, but works only for HTML files.
The alternative to apply the setting for all files recognized by Beautify is to add a file named `.jsbeautifyrc` at the root of the workspace, with the following content:
```
{
... | You can also set `Trim Final New lines` to on and `set Max Preserve New lines` to your need.
[](https://i.stack.imgur.com/wQJhT.png) |
14,360,294 | I need to get the count of all cells in a DataTable, how can i do this ? I need this to verify that my 2 tables has the same cell amount before inserting data into a database. | 2013/01/16 | [
"https://Stackoverflow.com/questions/14360294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1323884/"
] | Replace
```
self.editSettings = [self.editSettings initWithCustomView:imageView];
```
with
```
[self.editSettings setCustomView:imageView];
```
Hope this helps you.. | After you instantiate your custom item, you need to set a target and an action on it.
e.g.
```
if(self.editSettings) // make sure it exists
{
self.editSettings.target = self;
self.editSettings.action = @selector(doSomething:)
}
```
(assuming you have a method named "`doSomething:`" in your view controller.... |
14,360,294 | I need to get the count of all cells in a DataTable, how can i do this ? I need this to verify that my 2 tables has the same cell amount before inserting data into a database. | 2013/01/16 | [
"https://Stackoverflow.com/questions/14360294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1323884/"
] | Replace
```
self.editSettings = [self.editSettings initWithCustomView:imageView];
```
with
```
[self.editSettings setCustomView:imageView];
```
Hope this helps you.. | You can have a create action method for that bar button item and then connect that action in xib you can do this programmatically also using below code:
```
self.navigationController.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonItemStylePlain target:self action:@selec... |
10,029,905 | How can I use `contains` and `iexact` Field lookups at the same query in Django?
Like that ..
```
casas = Casa.objects.filter(nome_fantasia__contains__iexact='green')
``` | 2012/04/05 | [
"https://Stackoverflow.com/questions/10029905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1257304/"
] | If you need case-insensitive `contains`, use [`icontains`](https://docs.djangoproject.com/en/dev/ref/models/querysets/#icontains):
```
casas = Casa.objects.filter(nome_fantasia__icontains = 'green')
```
Which is converted to
```
... WHERE nome_fantasia ILIKE '%green%'
```
in SQL. | Honestly, you don't need to. The two resultsets overlap. If you were intending `AND` then just use the most restrictive: `__iexact`. if you want `OR` use `__contains`
Just to answer your question you could do something like below (note this is an `AND`)
```
casas = Casa.objects.filter(nome_fantasia__contains='green',... |
20,415,345 | Excuse the title, I couldn't find a better way to express the issue. Anyways, I don't have any sort of error, but I want to know if there is a way to simplify this:
```
#include <iostream>
int main(void)
{
const int Lbs_per_stone = 14;
int lbs;
std::cout << "Enter your weight in pounds: ";
std::cin... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20415345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2984806/"
] | Read about `std::div`, declared in `<cstdlib>`. | If you don't want to store them in variables, then don't:
```
int main()
{
const int LBS_PER_STONE = 14;
int lbs;
std::cout << "Enter weight in pounds: ";
std::cin >> lbs;
std::cout << "Your weight is " << (lbs / LBS_PER_STONE) << " and " << (lbs % LBS_PER_STONE) << " pounds" << std::endl;
ret... |
20,415,345 | Excuse the title, I couldn't find a better way to express the issue. Anyways, I don't have any sort of error, but I want to know if there is a way to simplify this:
```
#include <iostream>
int main(void)
{
const int Lbs_per_stone = 14;
int lbs;
std::cout << "Enter your weight in pounds: ";
std::cin... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20415345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2984806/"
] | There are a couple things you could do if this bothers you:
**Use a class**
```
template <typename T>
struct Div_Mod
{
Div_Mod(T a, T b) : div(a/b), mod(a % b) { }
T div, mod;
};
Div_Mod<int> weight(lbs, LBS_PER_STONE);
std::cout << weight.div << ' ' << weight.mod << '\n';
```
**Ensuring optimal machine co... | If you don't want to store them in variables, then don't:
```
int main()
{
const int LBS_PER_STONE = 14;
int lbs;
std::cout << "Enter weight in pounds: ";
std::cin >> lbs;
std::cout << "Your weight is " << (lbs / LBS_PER_STONE) << " and " << (lbs % LBS_PER_STONE) << " pounds" << std::endl;
ret... |
20,415,345 | Excuse the title, I couldn't find a better way to express the issue. Anyways, I don't have any sort of error, but I want to know if there is a way to simplify this:
```
#include <iostream>
int main(void)
{
const int Lbs_per_stone = 14;
int lbs;
std::cout << "Enter your weight in pounds: ";
std::cin... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20415345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2984806/"
] | Read about `std::div`, declared in `<cstdlib>`. | You don't mean something obvious like:
```
std::cout << lbs << " pounds are " << (lbs / lbs_per_stone)
<< " stone and " << (lbs % lbs_per_stone) << pound(s)." << std::endl;
```
The only other way to save an int (without using temporaries) is by deducting the stones from lbs:
```
std::cout << lbs << " pounds ar... |
20,415,345 | Excuse the title, I couldn't find a better way to express the issue. Anyways, I don't have any sort of error, but I want to know if there is a way to simplify this:
```
#include <iostream>
int main(void)
{
const int Lbs_per_stone = 14;
int lbs;
std::cout << "Enter your weight in pounds: ";
std::cin... | 2013/12/06 | [
"https://Stackoverflow.com/questions/20415345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2984806/"
] | There are a couple things you could do if this bothers you:
**Use a class**
```
template <typename T>
struct Div_Mod
{
Div_Mod(T a, T b) : div(a/b), mod(a % b) { }
T div, mod;
};
Div_Mod<int> weight(lbs, LBS_PER_STONE);
std::cout << weight.div << ' ' << weight.mod << '\n';
```
**Ensuring optimal machine co... | You don't mean something obvious like:
```
std::cout << lbs << " pounds are " << (lbs / lbs_per_stone)
<< " stone and " << (lbs % lbs_per_stone) << pound(s)." << std::endl;
```
The only other way to save an int (without using temporaries) is by deducting the stones from lbs:
```
std::cout << lbs << " pounds ar... |
32,453,806 | I really don't get this chrome error:
>
> Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null'
>
>
>
In Edge, Firefox and IE no errors.
I use jquery 1.11.1 and jquery mobile 1.4.5.
This is my index file:
```
<!DOCTYPE html>
<html>
<head>
... | 2015/09/08 | [
"https://Stackoverflow.com/questions/32453806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2970507/"
] | Add this:
```
<script>
$(document).bind('mobileinit',function(){
$.mobile.changePage.defaults.changeHash = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
});
</script>
```
Just before jquery.mobile-1.4.5.min.js
That works with Android WebViewClient ... | The Solution for me was that i have to run a webserver. It's a new chrome security feature and wont be changed according Chromium Bug Post.
Thanks to A. Wolff! |
32,453,806 | I really don't get this chrome error:
>
> Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null'
>
>
>
In Edge, Firefox and IE no errors.
I use jquery 1.11.1 and jquery mobile 1.4.5.
This is my index file:
```
<!DOCTYPE html>
<html>
<head>
... | 2015/09/08 | [
"https://Stackoverflow.com/questions/32453806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2970507/"
] | The Solution for me was that i have to run a webserver. It's a new chrome security feature and wont be changed according Chromium Bug Post.
Thanks to A. Wolff! | This can also be caused by Turbolinks (HTML pushState) when working with a local HTML file. |
32,453,806 | I really don't get this chrome error:
>
> Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null'
>
>
>
In Edge, Firefox and IE no errors.
I use jquery 1.11.1 and jquery mobile 1.4.5.
This is my index file:
```
<!DOCTYPE html>
<html>
<head>
... | 2015/09/08 | [
"https://Stackoverflow.com/questions/32453806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2970507/"
] | Add this:
```
<script>
$(document).bind('mobileinit',function(){
$.mobile.changePage.defaults.changeHash = false;
$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;
});
</script>
```
Just before jquery.mobile-1.4.5.min.js
That works with Android WebViewClient ... | This can also be caused by Turbolinks (HTML pushState) when working with a local HTML file. |
41,007,703 | I want to remove the border that is wrapped around my image, thumbnail label. I tried adding another class "noborder" and give it under my .col-md-4.noborder css rule, I give border 0 none and box-shadow 0 none but it doesn't work. Please help.
```css
.col-md-4.noborder {
border: 0 none;
box-shadow: none;
... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41007703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2935569/"
] | The border is on the thumbnail class. This should remove it.
```
.thumbnail {
border: 0 !important;
}
``` | the border is declared to `.thumbnail`
```
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: border .2s ease-in-out;
-o-transition: border .2s ease-in-out;... |
41,007,703 | I want to remove the border that is wrapped around my image, thumbnail label. I tried adding another class "noborder" and give it under my .col-md-4.noborder css rule, I give border 0 none and box-shadow 0 none but it doesn't work. Please help.
```css
.col-md-4.noborder {
border: 0 none;
box-shadow: none;
... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41007703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2935569/"
] | The border is on the thumbnail class. This should remove it.
```
.thumbnail {
border: 0 !important;
}
``` | Can you add noborder class to thumbnail div
```
<div class="col-md-4">
<div class="thumbnail noborder">
<img src="..." alt="...">
<div class="caption">
<h3 align="center">Thumbnail label</h3>
<p align="center">...</p>
</div>
... |
41,007,703 | I want to remove the border that is wrapped around my image, thumbnail label. I tried adding another class "noborder" and give it under my .col-md-4.noborder css rule, I give border 0 none and box-shadow 0 none but it doesn't work. Please help.
```css
.col-md-4.noborder {
border: 0 none;
box-shadow: none;
... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41007703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2935569/"
] | The border is on the thumbnail class. This should remove it.
```
.thumbnail {
border: 0 !important;
}
``` | Your `.col-md-4` has no border property set. Setting it to no border will not do anything since it didn't have border to begin with.
To specifically set `.thumbnail` in `.col-md-4.noborder` to have no border, you can refer to the snippet below.
```css
.col-md-4.noborder .thumbnail, .col-md-4.noborder .thumbnail img {... |
41,007,703 | I want to remove the border that is wrapped around my image, thumbnail label. I tried adding another class "noborder" and give it under my .col-md-4.noborder css rule, I give border 0 none and box-shadow 0 none but it doesn't work. Please help.
```css
.col-md-4.noborder {
border: 0 none;
box-shadow: none;
... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41007703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2935569/"
] | the border is declared to `.thumbnail`
```
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
-webkit-transition: border .2s ease-in-out;
-o-transition: border .2s ease-in-out;... | Your `.col-md-4` has no border property set. Setting it to no border will not do anything since it didn't have border to begin with.
To specifically set `.thumbnail` in `.col-md-4.noborder` to have no border, you can refer to the snippet below.
```css
.col-md-4.noborder .thumbnail, .col-md-4.noborder .thumbnail img {... |
41,007,703 | I want to remove the border that is wrapped around my image, thumbnail label. I tried adding another class "noborder" and give it under my .col-md-4.noborder css rule, I give border 0 none and box-shadow 0 none but it doesn't work. Please help.
```css
.col-md-4.noborder {
border: 0 none;
box-shadow: none;
... | 2016/12/07 | [
"https://Stackoverflow.com/questions/41007703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2935569/"
] | Can you add noborder class to thumbnail div
```
<div class="col-md-4">
<div class="thumbnail noborder">
<img src="..." alt="...">
<div class="caption">
<h3 align="center">Thumbnail label</h3>
<p align="center">...</p>
</div>
... | Your `.col-md-4` has no border property set. Setting it to no border will not do anything since it didn't have border to begin with.
To specifically set `.thumbnail` in `.col-md-4.noborder` to have no border, you can refer to the snippet below.
```css
.col-md-4.noborder .thumbnail, .col-md-4.noborder .thumbnail img {... |
59,237,724 | I need to use the previous value in the derived column to get the next result for the same column .
**1st occurrence of each name will be 1 by default**
derived column = num(i) + derived (i-1)
```
Name, Num, derived
A 0 1
A 1 2
A 0 2
B 0 1
B 0 1
B ... | 2019/12/08 | [
"https://Stackoverflow.com/questions/59237724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179650/"
] | >
> I have three radio buttons (in the same button group) that need to be added to only one cell in the GridLayout.
>
>
>
You create a `JPanel` and add each of the three `JRadioButton` to the panel. Then you add the panel to the cell in your panel using the `GridLayout`.
This is how you achieve more complex layou... | As advised by [camickr](https://stackoverflow.com/a/59239095/3992939) wrap the 3 radio buttons with a `JPanel` and add it to 'right':
```
JPanel rButtons = new JPanel(); //uses FlowLayout by default
rButtons.add(radioButton);
rButtons.add(radioButton_1);
rButtons.add(radioButton_2);
right.add(rButt... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | A good gem for handling this in the model: <https://github.com/rmm5t/strip_attributes>
It defines a `before_validation` hook that trims whitespaces and sets empty strings to nil. | You could do this using inject, which is obvious as to what is happening.
```
params = params.inject({}){|new_params, kv|
new_params[kv[0]] = kv[1].blank? ? nil : kv[1]
new_params
}
```
There is also a hack you can do with merge by merging with itself, and passing a block to handle the new value (although this ... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | In the ApplicationController:
```
class ApplicationController < ActionController::Base
def nilify(p)
p.transform_values!{|v| v.present? ? v : nil }
end
end
```
In your controller, modify the strong parameters filter method to call nilify:
```
class UserController < ApplicationController
def user_params... | Chris,
Here is a recursive parsing of params that have blanc values.
```
before_filter :process_params
......
private
def process_params
....
set_blanc_values_to_nil(params)
end
# Maybe move method to ApplicationController
# recursively sets all blanc values to nil
def set_blanc_values_to_nil!(my_hash)
my_ha... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | In the ApplicationController:
```
class ApplicationController < ActionController::Base
def nilify(p)
p.transform_values!{|v| v.present? ? v : nil }
end
end
```
In your controller, modify the strong parameters filter method to call nilify:
```
class UserController < ApplicationController
def user_params... | I generalized an answer and made a hook/extension that can be used as an initializer. This allows it to be used across multiple models. I've added it as part of my [ActiveRecordHelpers repo on GitHub](https://github.com/svargo/active-record-helpers) |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | You can use *[attribute\_normalizer](https://github.com/mdeering/attribute_normalizer)* gem and use the *blank* normalizer that will transform empty strings in nil values. | I generalized an answer and made a hook/extension that can be used as an initializer. This allows it to be used across multiple models. I've added it as part of my [ActiveRecordHelpers repo on GitHub](https://github.com/svargo/active-record-helpers) |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | A good gem for handling this in the model: <https://github.com/rmm5t/strip_attributes>
It defines a `before_validation` hook that trims whitespaces and sets empty strings to nil. | Use the "in place" collect method (also known as map!)
```
params[:user].collect! {|c| c == "" ? nil : c}
``` |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | A good gem for handling this in the model: <https://github.com/rmm5t/strip_attributes>
It defines a `before_validation` hook that trims whitespaces and sets empty strings to nil. | before\_save seems like the wrong location to me, what if you want to use the value before saving. So I overrode the setters instead:
```
# include through module or define under active_record
def self.nil_if_blank(*args)
args.each do |att|
define_method att.to_s + '=' do |val|
val = nil if val.respond_to?... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | You could do this using inject, which is obvious as to what is happening.
```
params = params.inject({}){|new_params, kv|
new_params[kv[0]] = kv[1].blank? ? nil : kv[1]
new_params
}
```
There is also a hack you can do with merge by merging with itself, and passing a block to handle the new value (although this ... | Chris,
Here is a recursive parsing of params that have blanc values.
```
before_filter :process_params
......
private
def process_params
....
set_blanc_values_to_nil(params)
end
# Maybe move method to ApplicationController
# recursively sets all blanc values to nil
def set_blanc_values_to_nil!(my_hash)
my_ha... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | Consider what you're doing here by using filters in the controller to affect how a model behaves when saved or updated. I think a much cleaner method would be a `before_save` call back in the model or an observer. This way, you're getting the same behavior no matter where the change originates from, whether its via a c... | You can use *[attribute\_normalizer](https://github.com/mdeering/attribute_normalizer)* gem and use the *blank* normalizer that will transform empty strings in nil values. |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | You can use *[attribute\_normalizer](https://github.com/mdeering/attribute_normalizer)* gem and use the *blank* normalizer that will transform empty strings in nil values. | Here is how I did it.
```
def remove_empty_params(param, key)
param[key] = param[key].reject { |c| c.empty? }
end
```
and call it with
```
remove_empty_params(params[:shipments], :included_clients)
```
No need to get super tricky in the model. And this way you can control which params get cleaned up.
```
param... |
1,183,506 | When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) and if a field is blank, set it to nil before updating attributes. I can't figure out how to do this though as the only way I know to iterate creates ... | 2009/07/26 | [
"https://Stackoverflow.com/questions/1183506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/135692/"
] | Consider what you're doing here by using filters in the controller to affect how a model behaves when saved or updated. I think a much cleaner method would be a `before_save` call back in the model or an observer. This way, you're getting the same behavior no matter where the change originates from, whether its via a c... | Ordinarily I would encourage functionality to be moved into the model, as stated in other answers this means that you will get the same behavior no matter where the change originates from.
However, I don't think in this case it is correct. The affect being noticed is purely down to not being able to encode the differe... |
51,239,617 | first of all, sorry for my English,
I am a newbie in stored procedure, so i'm seek for a help on it.
I have a project that need me to create a SP for a configurable table name and column name. I've manage to pass the table name and column name value from vb/vb.net and now i'm stuck on SP, below are sample of my code.... | 2018/07/09 | [
"https://Stackoverflow.com/questions/51239617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5648177/"
] | Hide the webview when an error occured.
```
@Override
public void onReceivedError(WebView webview, int i, String s, String s1)
{
WebView.setVisibility(View.GONE);**hide the webview when an error occured**
Intent intent = new Intent(MainActivity.this, ErrorActivity.class);
... | Regarding hiding the share menu icon, you could always use `onPrepareOptionsMenu()` to hide your share menu if there is any error flag.
```
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.share).setVisible(!isPageError);
return true;
}
```
w... |
1,363,535 | I have the following configuration:
* A host Windows Vista Home Premium SP2 with SQL Server 2008 Express SP1 and SQL Server Management Studio.
* A Virtual PC 2007 machine with Windows Vista Ultimate, Visual Studio 2008 Express and Visual Studio 2010 Beta 1.
With SP1 on the host machine and before installing Vista SP2... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1363535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166725/"
] | I finally found what I was missing. I entered the Network Sharing Center and configured my network as public instead of private. I did it both on the host and the virtual machine and now communication is back again. I’m not sure why this works, as the public network configuration is supposed to be more restrictive.
Th... | When you reinstalled, did you first uninstall SQL then reinstall? May be in that process, you uninstalled the named instance (MACHINE\_NAME\SQLEXPRESS)(Seen as SQL Server (SQLEXPRESS) in Windows Service) & installed a default instance (MACHINE\_NAME)(Seen as MSSQLSERVER in Windows Services).
Also I have observed that,... |
23,622,503 | Is there any callback function available, which is triggered while we attach a texture map to a material using the slate material editor.
Reason:
I have a custom material and if the user don't have a valid license I don't want him to attach any texture to the custom material. In the Compact material editor I achiev... | 2014/05/13 | [
"https://Stackoverflow.com/questions/23622503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2168052/"
] | Yes, the query you posted is the correct way of doing it. However, if you want to get objects created more than 48 hours ago, you'll want to change it to `date_created__lte`. Also, you can pass in hours into a `timedelta`. For example: `datetime.timedelta(hours=48)`.
Relevant links:
* [Django filter older amount of d... | To avoid the naive date time warning, you may want to switch out:
```
datetime.now()
```
for:
```
timezone.now()
``` |
54,902,133 | So I have this table that has dynamic headers.
[](https://i.stack.imgur.com/YzvyO.png)
The query below is used to generate the dates that will be used for the table's query.
```
select listagg(INSERT_DATE,
''',''') WITHIN GROUP(ORDER BY INSERT_DATE)... | 2019/02/27 | [
"https://Stackoverflow.com/questions/54902133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11123667/"
] | As it turns out, this is a bug in Actions on Google and they are working on it. | Media responses are supported out of the box only on Android and Google home devices. You must check for the surface capabilities before trying to play the audio. You can check <https://developers.google.com/actions/assistant/responses#media_responses> for more options and suggestions.
What I would suggest is if you ... |
57,596,037 | I have configured logback xml for a spring boot project.
I want to configure another appender based on the property configured. We want to create an appender either for JSON logs or for text log, this will be decided either by property file or by environment variable.
So I am thinking about the best approach to do th... | 2019/08/21 | [
"https://Stackoverflow.com/questions/57596037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3610891/"
] | As you're already using Spring, I suggest using [Spring Profiles](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html), lot cleaner than trying to do the same programmatically. This approach is also outlined in [Spring Boot docs](https://docs.spring.io/spring-boot/docs/current/ref... | As the previous answer states, you can set different appenders based on Spring Profiles.
However, if you do not want to rely on that feature, you can use environments variables as described in the [Logback manual](http://logback.qos.ch/manual/configuration.html#defaultValuesForVariables). I.e.:
```xml
<appender name=... |
50,487,013 | I have a viewport define like this with a tabpanel
```
Ext.define('rgpd.view.Viewport', {
extend: 'Ext.container.Viewport',
layout: 'border',
requires: [
'rgpd.view.entity1.View',
'rgpd.view.entity2.View',
'rgpd.view.entity3.View',
'rgpd.view.entity4.View',
'rgpd.vie... | 2018/05/23 | [
"https://Stackoverflow.com/questions/50487013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9798873/"
] | Use [setVisible](https://docs.sencha.com/extjs/6.2.0/classic/Ext.Component.html#method-setVisible) function to change visibility of a component
add this to `tabPanel`
```
listeners: {
boxready: function(){
if(condition){
this.down("entity1").setVisible(true);
this.down("entity... | ok here is how i did
```
this.getTabBar().getComponent(item_index).hide();
```
item\_index can be found like this: you have `this.items.indexMap` which is an array where keys are the items xtypes and values are the index in items array.
set all the items to visible as default, make an array of items to hide
```
to ... |
14,874,626 | When am asked to fix an issue, by understanding the code-flow, i find the URL which is been hit and then i go to the controller which is mapped to that particular URL
I find the process `very tedious` as we have some 50 controller classes and more methods annotated with urls inside it
Right now, i use search-option i... | 2013/02/14 | [
"https://Stackoverflow.com/questions/14874626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849632/"
] | if you are using Spring MVC 3.x Checkout the link .
[Endpoint documentation controller for Spring MVC 3.x](http://www.java-allandsundry.com/2012/03/endpoint-documentation-controller-for.html) | Maybe the [Reflections](https://code.google.com/p/reflections/) library can help:
```
Reflections reflections = new Reflections("my.package",
new TypeAnnotationsScanner(), new MethodAnnotationsScanner());
Set<Class<?>> controllers = reflections.getTypesAnnotatedWith(Controller.class);
Set<Method> requestMappi... |
21,841,668 | im trying to print and count a certain array from my table. i want to print 'O' and count how many times it pops up. The counting part i got it but to print the 'O' in a table format i cant. Everytime i would try to print the 'O' it gives me happy faces.
```
char poste[]={'A','P','A','P','A','O','P','P','O'};
for(i=0;... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21841668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3268216/"
] | You are printing `poste[i]=='O'`. What you want to do is as follows:
```
for ( i = 0; i < 9; i++ )
if ( poste[i] == 'O' )
printf ( "%c", poste[i] );
``` | Your line `printf("%c",poste[i]=='O')` is printing a character. Which character? Well, `poste[i]=='O'` is a condition. Conditions return `true` or `false`. When those values get converted into a character, they will first be converted to an int, `1` or `0`, and then a char, '☺' (which is the character with ascii value ... |
21,841,668 | im trying to print and count a certain array from my table. i want to print 'O' and count how many times it pops up. The counting part i got it but to print the 'O' in a table format i cant. Everytime i would try to print the 'O' it gives me happy faces.
```
char poste[]={'A','P','A','P','A','O','P','P','O'};
for(i=0;... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21841668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3268216/"
] | You are printing `poste[i]=='O'`. What you want to do is as follows:
```
for ( i = 0; i < 9; i++ )
if ( poste[i] == 'O' )
printf ( "%c", poste[i] );
``` | ```
printf("%c",poste[i]=='O');
```
Here `poste[i] == 'O'`, this evaluates to either 1 (true, `poste[i]` is equal to `'O'`) or 0 (false, it isn't equal).
This result is of type `int`, but you're telling `printf` it is a `char`. Since `int`s and `char`s are not the same type and not equal in size this leads to weird ... |
21,841,668 | im trying to print and count a certain array from my table. i want to print 'O' and count how many times it pops up. The counting part i got it but to print the 'O' in a table format i cant. Everytime i would try to print the 'O' it gives me happy faces.
```
char poste[]={'A','P','A','P','A','O','P','P','O'};
for(i=0;... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21841668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3268216/"
] | You are printing `poste[i]=='O'`. What you want to do is as follows:
```
for ( i = 0; i < 9; i++ )
if ( poste[i] == 'O' )
printf ( "%c", poste[i] );
``` | You are printing the result of the expression `poste[i]=='O'`.
Replace `printf("%c",poste[i]=='O');`
with `if (poste[i] == 'O') printf("O");` |
213,424 | I am trying to separate the thin layer of laminate that is glued to the chipboard.
I have so far managed to cut the piece across the width, and after soaking it in water for several days the chipboard does come off a little if a scrape it with the teeth of a saw, but there is a high risk of damaging the laminate.
Is ... | 2021/01/09 | [
"https://diy.stackexchange.com/questions/213424",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/120060/"
] | The problem you should be aware of is most walls aren't precisely square (Nor plumb). So if your tape measure reads 27 inches at the niche opening it may read 26 1/2 inches at the back of the opening (or 28 inches!). You should take measurements from different points of where the appliance will go. (3) minimum: front, ... | The "by the book" answer is that electric code requires appliances to be installed according to manufacturer's instructions, so you'll have to refer to the clearances stipulated by the manufacturer for any particular model.
You've called the space an "opening." I'm envisioning it as an alcove - a recessed space in a w... |
213,424 | I am trying to separate the thin layer of laminate that is glued to the chipboard.
I have so far managed to cut the piece across the width, and after soaking it in water for several days the chipboard does come off a little if a scrape it with the teeth of a saw, but there is a high risk of damaging the laminate.
Is ... | 2021/01/09 | [
"https://diy.stackexchange.com/questions/213424",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/120060/"
] | The problem you should be aware of is most walls aren't precisely square (Nor plumb). So if your tape measure reads 27 inches at the niche opening it may read 26 1/2 inches at the back of the opening (or 28 inches!). You should take measurements from different points of where the appliance will go. (3) minimum: front, ... | If you are worried about heat build up over time damaging the product, keep in mind the dryer is on top. It is *supposed* to get hot and vents out a duct.
In that regard, you are good to go. |
213,424 | I am trying to separate the thin layer of laminate that is glued to the chipboard.
I have so far managed to cut the piece across the width, and after soaking it in water for several days the chipboard does come off a little if a scrape it with the teeth of a saw, but there is a high risk of damaging the laminate.
Is ... | 2021/01/09 | [
"https://diy.stackexchange.com/questions/213424",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/120060/"
] | The problem you should be aware of is most walls aren't precisely square (Nor plumb). So if your tape measure reads 27 inches at the niche opening it may read 26 1/2 inches at the back of the opening (or 28 inches!). You should take measurements from different points of where the appliance will go. (3) minimum: front, ... | There are washer dryer combos out there at have zero side clearance. Only front, back and top. It will not make for an easy install, but even if you had 5" side clearance in an alcove install, will not make it any easier to hook up. Therefore, it is all about the layout, and removable access panels in the right place o... |
1,239,641 | Let the real-valued function $\phi:\mathbb{R}\to\mathbb{R}$ be defined by
$$\phi(t)=\int\_0^1e^{\sqrt{x^2+t^2}}\,\mathrm{d}x,$$
it can then be shown that $\phi$ is continuous and differentiable.
**I wish to find its derivative, in particular at $\mathbf{t = 0}$**. I believe, since the integration is independent of $t... | 2015/04/17 | [
"https://math.stackexchange.com/questions/1239641",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/112061/"
] | Let $x$ be a left zero divisior but not a right zero divisior.
Then set $f:R\to R$ by $f(r)=rx$. Notice that $f$ is one to one as, $r\_1x=r\_2x\implies (r\_1-r\_2)x=0\implies r\_1-r\_2=0$ as $x$ is not a right zero divisior.
Then $f$ must be onto as $R$ is finite which means there exist $r$ s.t. $1=rx$.
Since $x$ i... | Your method doesn't really work, since you cannot assume that $y =1 $. In fact, $1$ cannot be a zero divisor at all, since $1 \cdot x = 0$ is equivalent to $x = 0$.
You should examine the set $\{r \cdot x: r\in R\}$, for $x$ a left zero-divisor. Is it possible that $1 = rx$ if $xy = 0$ for some nonzero $y$? What can y... |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | Consider,
***thinking-outside-the-box***
>
> think outside (of) the box; *also* think out of the box: to develop ideas that are different and unusual. Usage notes: sometimes used with verbs other than think: *You need to look outside the box and see what you can come up with*. Etymology: based on the idea that limit... | Psychologists use the term "oppositional" as in "oppositional personality". It may not be in common use, but I think the meaning is immediately clear. |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | For some reason, all the answers so far seem to have missed the natural opposite of [going with the flow](http://dictionary.cambridge.org/dictionary/english/go-with-the-flow) — [**going *against* the flow**](http://dictionary.cambridge.org/dictionary/english/go-against-the-flow):
>
> to do or say the opposite of wha... | The common idiom **[bucking the trend](http://dictionary.cambridge.org/dictionary/english/buck-the-trend)** appears to fit your scenario:
>
> to be obviously different from the way that a situation is developing generally, especially in connection with financial matters
>
>
>
To adapt this into an adjecti... |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | For some reason, all the answers so far seem to have missed the natural opposite of [going with the flow](http://dictionary.cambridge.org/dictionary/english/go-with-the-flow) — [**going *against* the flow**](http://dictionary.cambridge.org/dictionary/english/go-against-the-flow):
>
> to do or say the opposite of wha... | The verbal "making waves" describes performing an act that doesn't go with the flow, as in "Rob was making waves at the board meeting." It has a nautical theme and acts as a verb, just like "going with the flow" does. But it can't be used as an adjective, which seems to be what your sentence is looking for. If you don'... |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | If you *don't go with the flow* then you [*go your own way*](http://dictionary.reference.com/browse/go-one-s-way) or [*do your own thing*](http://dictionary.cambridge.org/dictionary/english/do-your-own-thing). Admittedly, for your sample sentence, *go-my-own-way personality* might be a bit cumbersome. So you may prefer... | The verbal "making waves" describes performing an act that doesn't go with the flow, as in "Rob was making waves at the board meeting." It has a nautical theme and acts as a verb, just like "going with the flow" does. But it can't be used as an adjective, which seems to be what your sentence is looking for. If you don'... |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | How about "going against the grain"?
<https://en.wiktionary.org/wiki/against_the_grain> | The common idiom **[bucking the trend](http://dictionary.cambridge.org/dictionary/english/buck-the-trend)** appears to fit your scenario:
>
> to be obviously different from the way that a situation is developing generally, especially in connection with financial matters
>
>
>
To adapt this into an adjecti... |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | Consider *[stick-in-the-mud](http://www.oxforddictionaries.com/us/definition/american_english/stick-in-the-mud)*.
>
> A person who is dull and unadventurous and who resists change.
>
>
>
*Oxford Dictionaries Online*
Such an inhabitant of a stream (cultural or otherwise) surely resists *going with the flow* | Psychologists use the term "oppositional" as in "oppositional personality". It may not be in common use, but I think the meaning is immediately clear. |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | How about -- [Marches to the beat of a different drummer](http://www.thesaurus.com/browse/marching+to+the+beat+of+a+different+drummer).
This describes someone who doesn't go along with general march of the masses who listen to the drummer for the masses. But does a different "march" listening to a different drummer.
... | Psychologists use the term "oppositional" as in "oppositional personality". It may not be in common use, but I think the meaning is immediately clear. |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | I believe *[swimming upstream](https://en.wiktionary.org/wiki/swim_upstream)* is about as opposite a sentiment as you can get. It even means the opposite in the two phrases' literal sense. | Psychologists use the term "oppositional" as in "oppositional personality". It may not be in common use, but I think the meaning is immediately clear. |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | If you *don't go with the flow* then you [*go your own way*](http://dictionary.reference.com/browse/go-one-s-way) or [*do your own thing*](http://dictionary.cambridge.org/dictionary/english/do-your-own-thing). Admittedly, for your sample sentence, *go-my-own-way personality* might be a bit cumbersome. So you may prefer... | ***stubborn-as-a-mule***
is a way of saying someone is extremely [obstinate](http://idioms.thefreedictionary.com/stubborn+as+a+mule) and reluctant to follow others.
This can be shortened to the adjective ***mulish***. |
300,253 | According to the Cambridge dictionary, going with the flow is defined as to do what other people are doing or to agree with other people because it is the easiest thing to do.
I am writing a paper and I'm really stumped as to what would be an idiom, or a way to describe a person who is *not* [going with the flow... | 2016/01/16 | [
"https://english.stackexchange.com/questions/300253",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/155746/"
] | I believe *[swimming upstream](https://en.wiktionary.org/wiki/swim_upstream)* is about as opposite a sentiment as you can get. It even means the opposite in the two phrases' literal sense. | ***stubborn-as-a-mule***
is a way of saying someone is extremely [obstinate](http://idioms.thefreedictionary.com/stubborn+as+a+mule) and reluctant to follow others.
This can be shortened to the adjective ***mulish***. |
4,523,874 | So I have a class of overloaded methods like this:
```
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
```
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type un... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4523874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407236/"
] | Overriding is what has dynamic binding in Java. Overloading has static binding, and which function is called is determined at compile time, not at runtime. [See this SO question.](https://stackoverflow.com/questions/321864/java-dynamic-binding-and-method-overriding)
Therefore you can't use overloading for run time sel... | Overloaded method resolution happens at compile time in Java. You'll have to do the resolution yourself (a switch, if-then-else ladder or table-lookup), or find a different pattern that can be implemented in Java. |
4,523,874 | So I have a class of overloaded methods like this:
```
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
```
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type un... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4523874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407236/"
] | Overriding is what has dynamic binding in Java. Overloading has static binding, and which function is called is determined at compile time, not at runtime. [See this SO question.](https://stackoverflow.com/questions/321864/java-dynamic-binding-and-method-overriding)
Therefore you can't use overloading for run time sel... | I'm not sure you want an answer to this question. You're interested in setting up a situation where
```
test((String)x)
```
does not do the same thing as
```
test((Object)x)
```
For `x` which are `String`s. This is a Bad Idea™ and will just lead to lots of confusion. Use a different method name if you really want... |
4,523,874 | So I have a class of overloaded methods like this:
```
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
```
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type un... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4523874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407236/"
] | Overriding is what has dynamic binding in Java. Overloading has static binding, and which function is called is determined at compile time, not at runtime. [See this SO question.](https://stackoverflow.com/questions/321864/java-dynamic-binding-and-method-overriding)
Therefore you can't use overloading for run time sel... | This is a job for the Visitor pattern. |
4,523,874 | So I have a class of overloaded methods like this:
```
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
```
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type un... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4523874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407236/"
] | This is a job for the Visitor pattern. | Overloaded method resolution happens at compile time in Java. You'll have to do the resolution yourself (a switch, if-then-else ladder or table-lookup), or find a different pattern that can be implemented in Java. |
4,523,874 | So I have a class of overloaded methods like this:
```
class Foo {
public void test(Object value) {
...
}
public void test(String value) {
...
}
}
```
I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type un... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4523874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407236/"
] | This is a job for the Visitor pattern. | I'm not sure you want an answer to this question. You're interested in setting up a situation where
```
test((String)x)
```
does not do the same thing as
```
test((Object)x)
```
For `x` which are `String`s. This is a Bad Idea™ and will just lead to lots of confusion. Use a different method name if you really want... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.