qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
2,608,763
While debugging slow startup of an Eclipse RCP app on a Citrix server, I came to find out that java.io.createTempFile(String,String,File) is taking 5 seconds. It does this only on the first execution and only for certain user accounts. Specifically, I am noticing it Citrix anonymous user accounts. I have not tried many...
2010/04/09
[ "https://Stackoverflow.com/questions/2608763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312944/" ]
It might be the intialisation of the secure random number generator which is causing the problem. In particular if a secure random seed is not obtainable from the operating system, then the fall-back mechanism attempts to gain entropy. IIRC, one of the things it does is to list temporary files, so if you have a large n...
It looks like the slowness is due to the seeding of SecureRandom and only when the user is a member of the Guests group. The SecureRandom seed initialization uses a Windows Crypto API which fails when the user is a guest as described here [1]. By setting the system property "java.security.debug" equal to "all", I can ...
2,608,763
While debugging slow startup of an Eclipse RCP app on a Citrix server, I came to find out that java.io.createTempFile(String,String,File) is taking 5 seconds. It does this only on the first execution and only for certain user accounts. Specifically, I am noticing it Citrix anonymous user accounts. I have not tried many...
2010/04/09
[ "https://Stackoverflow.com/questions/2608763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312944/" ]
It looks like the slowness is due to the seeding of SecureRandom and only when the user is a member of the Guests group. The SecureRandom seed initialization uses a Windows Crypto API which fails when the user is a guest as described here [1]. By setting the system property "java.security.debug" equal to "all", I can ...
I'm not a Citrix expert, but I know someone who is, and who conjectures: The accounts may be set up so that application reads/writes are redirected to non-local resources. The latency you're experiencing may be related to the initialization or performance of that resolution. Another possibility is that the applicatio...
153,510
I am having problems getting lengths from multilinestrings after transforming data from EPSG:27700 - OSGB 1936 / British National Grid to EPSG:4326/ WGS 84. I'm doing this conversion to import a roads shapefile into a PostGIS database that uses WGS84 as default. However, when I try to calulate lengths, I'm having weir...
2015/07/07
[ "https://gis.stackexchange.com/questions/153510", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/37933/" ]
The length functions work differently with 3D linestring geometries: * [`ST_Length`](http://postgis.net/docs/ST_Length.html) - returns 2D distances for `geometry` types, and oddly 3D distances for `geography` types (but not in this question) * [`ST_Length_Spheroid`](http://postgis.net/docs/ST_Length_Spheroid.html) - r...
Postgis is correct. Your line is in 3d space, and in fact has a length of ~482m even in the British National Grid. 338 meters is also correct but it corespondents in the projection of the 3d line in the 2d space. ``` with a as ( select st_Geomfromewkt('SRID=27700;MULTILINESTRING(( 423216.279 574665.249 0, 42...
23,764,324
from showing every time I run my Test Application in my AVD. I'm trying to show a maps and Eclipse shows no mistakes. So how can I fix this and how can I find out what the problem is if Eclipse shows no problems? (Here's a copy of my MainActivity) ``` package com.example.test; import android.app.Activity; impo...
2014/05/20
[ "https://Stackoverflow.com/questions/23764324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3657268/" ]
in manifest file ================ ``` <!-- Google API Key --> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOURAPIKEY" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> ```
You are missing `<meta-data>` tag in your `Android_Manifest.xml` So please add this along with ``` <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> ``` Also replace ``` <meta-data android:name="com.example.test..API_KEY" and...
23,764,324
from showing every time I run my Test Application in my AVD. I'm trying to show a maps and Eclipse shows no mistakes. So how can I fix this and how can I find out what the problem is if Eclipse shows no problems? (Here's a copy of my MainActivity) ``` package com.example.test; import android.app.Activity; impo...
2014/05/20
[ "https://Stackoverflow.com/questions/23764324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3657268/" ]
Looking at the code you are missing ``` ...// rest of the code <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> ``` You are missing ``` <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> ``` Also change this ...
You are missing `<meta-data>` tag in your `Android_Manifest.xml` So please add this along with ``` <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> ``` Also replace ``` <meta-data android:name="com.example.test..API_KEY" and...
23,764,324
from showing every time I run my Test Application in my AVD. I'm trying to show a maps and Eclipse shows no mistakes. So how can I fix this and how can I find out what the problem is if Eclipse shows no problems? (Here's a copy of my MainActivity) ``` package com.example.test; import android.app.Activity; impo...
2014/05/20
[ "https://Stackoverflow.com/questions/23764324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3657268/" ]
in manifest file ================ ``` <!-- Google API Key --> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOURAPIKEY" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> ```
PERMISSIONS ``` <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <permission android:name="com.example.test.permission.MAPS_RECEIVE" android:protect...
23,764,324
from showing every time I run my Test Application in my AVD. I'm trying to show a maps and Eclipse shows no mistakes. So how can I fix this and how can I find out what the problem is if Eclipse shows no problems? (Here's a copy of my MainActivity) ``` package com.example.test; import android.app.Activity; impo...
2014/05/20
[ "https://Stackoverflow.com/questions/23764324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3657268/" ]
Looking at the code you are missing ``` ...// rest of the code <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> ``` You are missing ``` <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> ``` Also change this ...
PERMISSIONS ``` <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <permission android:name="com.example.test.permission.MAPS_RECEIVE" android:protect...
7,055
I am working with ArcGIS 10.0. As a simple example let's say I have a map of the United States. I want to each row of the data which states have adjacent boundaries with that state - so that in the row for South Carolina there would be new variables adjacent\_1 and adjacent\_2 that list North Carolina and Georgia (or a...
2011/03/10
[ "https://gis.stackexchange.com/questions/7055", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/2270/" ]
You should be able to write a script that loops through every feature present in the feature class, execute a spatial query to select any adjoining features, loop through the results of the spatial query, and write a specific attribute from the resulting features into the original feature. Depending on how exactly you ...
This is what GIS is for. However if you want the duplication I think you will have to get creative and do some spatial joins. possibly make a copy of your polygon data and sp join that back to the original. ??
7,055
I am working with ArcGIS 10.0. As a simple example let's say I have a map of the United States. I want to each row of the data which states have adjacent boundaries with that state - so that in the row for South Carolina there would be new variables adjacent\_1 and adjacent\_2 that list North Carolina and Georgia (or a...
2011/03/10
[ "https://gis.stackexchange.com/questions/7055", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/2270/" ]
Buffer the features infinitesimally (such as one meter). Union the buffer layer with itself, thereby creating *k* records for each distinct overlap of *k* features. The records in this union include the identifiers of the parent features. Summarize the union on the concatenation of these two identifiers: this effective...
This is what GIS is for. However if you want the duplication I think you will have to get creative and do some spatial joins. possibly make a copy of your polygon data and sp join that back to the original. ??
7,055
I am working with ArcGIS 10.0. As a simple example let's say I have a map of the United States. I want to each row of the data which states have adjacent boundaries with that state - so that in the row for South Carolina there would be new variables adjacent\_1 and adjacent\_2 that list North Carolina and Georgia (or a...
2011/03/10
[ "https://gis.stackexchange.com/questions/7055", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/2270/" ]
Buffer the features infinitesimally (such as one meter). Union the buffer layer with itself, thereby creating *k* records for each distinct overlap of *k* features. The records in this union include the identifiers of the parent features. Summarize the union on the concatenation of these two identifiers: this effective...
You should be able to write a script that loops through every feature present in the feature class, execute a spatial query to select any adjoining features, loop through the results of the spatial query, and write a specific attribute from the resulting features into the original feature. Depending on how exactly you ...
7,055
I am working with ArcGIS 10.0. As a simple example let's say I have a map of the United States. I want to each row of the data which states have adjacent boundaries with that state - so that in the row for South Carolina there would be new variables adjacent\_1 and adjacent\_2 that list North Carolina and Georgia (or a...
2011/03/10
[ "https://gis.stackexchange.com/questions/7055", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/2270/" ]
You should be able to write a script that loops through every feature present in the feature class, execute a spatial query to select any adjoining features, loop through the results of the spatial query, and write a specific attribute from the resulting features into the original feature. Depending on how exactly you ...
I note that you are using ArcGIS Desktop 10.0, but if you were using ArcGIS 10.1 for Desktop or later then you would have access to the Polygon Neighbors tool. For more details see [Adding/updating field to polygon feature class that lists bordering (neighbor) polygons?](https://gis.stackexchange.com/questions/80363/a...
7,055
I am working with ArcGIS 10.0. As a simple example let's say I have a map of the United States. I want to each row of the data which states have adjacent boundaries with that state - so that in the row for South Carolina there would be new variables adjacent\_1 and adjacent\_2 that list North Carolina and Georgia (or a...
2011/03/10
[ "https://gis.stackexchange.com/questions/7055", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/2270/" ]
Buffer the features infinitesimally (such as one meter). Union the buffer layer with itself, thereby creating *k* records for each distinct overlap of *k* features. The records in this union include the identifiers of the parent features. Summarize the union on the concatenation of these two identifiers: this effective...
I note that you are using ArcGIS Desktop 10.0, but if you were using ArcGIS 10.1 for Desktop or later then you would have access to the Polygon Neighbors tool. For more details see [Adding/updating field to polygon feature class that lists bordering (neighbor) polygons?](https://gis.stackexchange.com/questions/80363/a...
19,013
I am currently analyzing a project and am encountering the following situation, where I'd like to know your point of view. For a specific content type we would like to allow users to place comments, but they should only see the comments made by users with the same role. Only administrators should be allowed to view th...
2012/01/06
[ "https://drupal.stackexchange.com/questions/19013", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/3902/" ]
My gut tell me that this plan will make your servers catch on fire... Seriously, if you are churning that much data, then I think you need to keep the data in an external datasource and then integrate it with Drupal. My initial thought would to use two databases for the external data, so that you can do the weekly im...
I think a node based (or even entity based) approach will burn out your server with millions of node. Besides, looking at your hourly import, that means your'll make a node\_save() at least once a second. That's too much for Drupal and cause a performance problem. The reason behind that is for those content, you won't...
27,170,348
I'm logging the testresults to DB while testNG runs the testcases. I'm using excel sheet to provide input data . For eg: ``` tablename row1 col1 row2 col2 tablename ``` I want to know, which row is getting executed ? There might be any function in dataprovider class which will b...
2014/11/27
[ "https://Stackoverflow.com/questions/27170348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479117/" ]
Well, your `query` dictionary is rather funky, for one, `'fowl'` and `'Year of the Monkey'` values are not structured the same, so you cannot aply the same data access patterns, or categories being misspelled as `'cateogry'`. If you can, you may be better off fixing that before trying to process it further. As for ext...
`query` is a dictionary not a list, so do `query['fowl']` instead
27,170,348
I'm logging the testresults to DB while testNG runs the testcases. I'm using excel sheet to provide input data . For eg: ``` tablename row1 col1 row2 col2 tablename ``` I want to know, which row is getting executed ? There might be any function in dataprovider class which will b...
2014/11/27
[ "https://Stackoverflow.com/questions/27170348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479117/" ]
Well, your `query` dictionary is rather funky, for one, `'fowl'` and `'Year of the Monkey'` values are not structured the same, so you cannot aply the same data access patterns, or categories being misspelled as `'cateogry'`. If you can, you may be better off fixing that before trying to process it further. As for ext...
`query['Year of the Monkey']['match'][0]['category']` you need to iterate
582,309
I just set up a freenas zfs raid-z2 with 4 drives sata enterprise drives and doing some performance tests. Right now I'm pushing and pulling linux images into the storage. My notebook has a samsung 840pro ssd with 400MB/s local read write speed. Samba4 is used. I can write with avg 105 MB/s in an continuous stream. I'...
2014/03/15
[ "https://serverfault.com/questions/582309", "https://serverfault.com", "https://serverfault.com/users/122722/" ]
You may want to read [this](https://blogs.oracle.com/roch/entry/when_to_and_not_to). Essentially, in a single RAID Z group, read performance is equal to the performance of a single disk. RAID Z is great for write performance and poor for read performance. Given the slow low-end disks you're using, the numbers you've ...
Even thought this post is rather old, I came accross it while I was looking for the solution to the exact same problem. So maybe others can benefit from my experience; I have a FreeNas setup where I can push up to a 110MB/s to it (write), but reading from it was twice as slow (50MB/s). Couldn't figure out why. Read ...
63,379,598
I had created a slider using react slick now there is a requirement to change transition and animation of slides on prev and next button click. Got some help that add class to currently active slide while changing slide and add animation and transition effect to it. And remove after it slides completely changed. I trie...
2020/08/12
[ "https://Stackoverflow.com/questions/63379598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660992/" ]
You can try Mathjax. The following works at my end (Python 3.9.1, dash==1.19.0, dash-html-components==1.1.2) First create a javascript file (anyname.js) in the assets folder of your current project. In that file have just the following line: ``` setInterval("MathJax.Hub.Queue(['Typeset',MathJax.Hub])",1000); ``` Th...
With plotly you have to use unicode. For example if you want to print a greek letter mu is "\u03bc". You can obtain some symbols from [here](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) and superscripts from [here](https://en.wikipedia.org/wiki/Superscripts_and_Subscripts_(Unicode_block)...
63,379,598
I had created a slider using react slick now there is a requirement to change transition and animation of slides on prev and next button click. Got some help that add class to currently active slide while changing slide and add animation and transition effect to it. And remove after it slides completely changed. I trie...
2020/08/12
[ "https://Stackoverflow.com/questions/63379598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660992/" ]
You can try Mathjax. The following works at my end (Python 3.9.1, dash==1.19.0, dash-html-components==1.1.2) First create a javascript file (anyname.js) in the assets folder of your current project. In that file have just the following line: ``` setInterval("MathJax.Hub.Queue(['Typeset',MathJax.Hub])",1000); ``` Th...
Install ```sh pip install dash -U ``` Code ```py import dash from dash import dcc, html app = dash.Dash() app.layout = html.Div([ dcc.Markdown('$Area (m^{2})$', mathjax=True), ]) app.run_server() ``` [![enter image description here](https://i.stack.imgur.com/bkgEC.png)](https://i.stack.imgur.com/bkgEC.png)
63,379,598
I had created a slider using react slick now there is a requirement to change transition and animation of slides on prev and next button click. Got some help that add class to currently active slide while changing slide and add animation and transition effect to it. And remove after it slides completely changed. I trie...
2020/08/12
[ "https://Stackoverflow.com/questions/63379598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660992/" ]
MathJax 3 works in Dash v2.3.0 which includes Plotly.js v2.10.0 with Markdown. Example: dcc.Markdown('$$y=x+1$$', mathjax=True)
With plotly you have to use unicode. For example if you want to print a greek letter mu is "\u03bc". You can obtain some symbols from [here](https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode) and superscripts from [here](https://en.wikipedia.org/wiki/Superscripts_and_Subscripts_(Unicode_block)...
63,379,598
I had created a slider using react slick now there is a requirement to change transition and animation of slides on prev and next button click. Got some help that add class to currently active slide while changing slide and add animation and transition effect to it. And remove after it slides completely changed. I trie...
2020/08/12
[ "https://Stackoverflow.com/questions/63379598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660992/" ]
MathJax 3 works in Dash v2.3.0 which includes Plotly.js v2.10.0 with Markdown. Example: dcc.Markdown('$$y=x+1$$', mathjax=True)
Install ```sh pip install dash -U ``` Code ```py import dash from dash import dcc, html app = dash.Dash() app.layout = html.Div([ dcc.Markdown('$Area (m^{2})$', mathjax=True), ]) app.run_server() ``` [![enter image description here](https://i.stack.imgur.com/bkgEC.png)](https://i.stack.imgur.com/bkgEC.png)
18,087
we have a custom PHP script which is running under JUMI to perform and display some data. The custom script is accessible to a SEF url such as ``` http://www.mysite.com/jumi-script ``` which is a rewritten version of ``` http://www.mysite.com/index.php?option=com_jumi&view=application&fileid=11&Itemid=271 ``` N...
2016/10/08
[ "https://joomla.stackexchange.com/questions/18087", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/9125/" ]
Looking at the router implementation of com\_jumi here <https://github.com/BonavalMultimedia/com_jumi/blob/master/com_jumi_bnvl/router.php> for me it seems it doesn't handle extra parameters when sef is on (see JumiParseRoute function). You need to modify this function to check for your extra parameters and add them t...
For your url `/index.php?option=com_jumi&view=application&fileid=11&Itemid=271&category=mycat&place=myplace` : ``` $JInput = JFactory::getApplication()->input; $myRequest = $JInput->getArray(array( 'option' =>'', 'view' =>'', 'fileid' =>'', 'Itemid' =>'', 'category'=>'', 'place' =>'...
63,472,578
I tried to create recursive function for generating Pascal's triangle as below. ``` numRows = 5 ans=[[1],[1,1]] def pascal(arr,pre,idx): if idx==numRows: return ans if len(arr)!=idx: for i in range (0,len(pre)-1,1): arr+=[pre[i]+pre[i+1]] i...
2020/08/18
[ "https://Stackoverflow.com/questions/63472578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9804823/" ]
I had the same issue, was fixed by specifying the import for act like this `import { renderHook, act } from '@testing-library/react-hooks/dom' // will use react-dom` based on documentation <https://react-hooks-testing-library.com/installation#renderer> for your case other import options might work, depending on what...
The warning was triggered because something down your chain of dependencies was calling `ReactDOM.render` directly. In `hooks.js` you have: ```js import { useManageNotifications } from "./notifications"; ``` In `notifications.js`: ```js import { notification, Alert } from "antd"; ``` The notification package fro...
36,286,017
Given the following data ``` A B Steven 01/05/1958 Mike 05/12/1923 Bob 05/11/2001 Richard 10/22/1985 Maverick 12/25/1991 Ed 01/07/1954 ``` I'd like to get a list in, let's just say the column D, containing the next couple birthdays that will occur. So if today was 05/05/2016, I'd lik...
2016/03/29
[ "https://Stackoverflow.com/questions/36286017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3653975/" ]
To get the birthday difference from today in days : ``` =(DATEDIF($D$1,DATE(IF((DATE(YEAR($D$1),MONTH(B2),DAY(B2))>$D$1),YEAR($D$1),YEAR($D$1)+1),MONTH(B2),DAY(B2)),"D"))+0 ``` The first BD from current date : ``` =VLOOKUP(SMALL(A2:A8,1)+0,A2:B8,2,FALSE) ``` Please see the img for more details :[![excel_BD](http...
OK slightly different approach Instead of counting days in a helper column, change the date in a helper column. Then sort that helper column for only the first 5 entries. This will show upcoming birthDAYS instead of birthDATES. So assuming Names in column A, Dates in Column B, Column C is created with: ``` =DATE(YEA...
36,286,017
Given the following data ``` A B Steven 01/05/1958 Mike 05/12/1923 Bob 05/11/2001 Richard 10/22/1985 Maverick 12/25/1991 Ed 01/07/1954 ``` I'd like to get a list in, let's just say the column D, containing the next couple birthdays that will occur. So if today was 05/05/2016, I'd lik...
2016/03/29
[ "https://Stackoverflow.com/questions/36286017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3653975/" ]
To get the birthday difference from today in days : ``` =(DATEDIF($D$1,DATE(IF((DATE(YEAR($D$1),MONTH(B2),DAY(B2))>$D$1),YEAR($D$1),YEAR($D$1)+1),MONTH(B2),DAY(B2)),"D"))+0 ``` The first BD from current date : ``` =VLOOKUP(SMALL(A2:A8,1)+0,A2:B8,2,FALSE) ``` Please see the img for more details :[![excel_BD](http...
Another approach would be to use the `Advanced Filter`. And you could automate it using VBA. For the Criteria: ``` A2: =DATE(YEAR(TODAY()),MONTH(B6),DAY(B6))>=TODAY() B2: =(TODAY()+$C$2)>=DATE(YEAR(TODAY()),MONTH(B6),DAY(B6)) ``` Range is the number of days after today to show birthdays. [![enter image descripti...
315,201
Here is my context, > > BECU is a non profit organisation, set up to protect the interests of their customers. But news media is using it as their **weapon** to score political point. > > > Weapon is a violent word, and I would like to use an alternative word here. Could somebody recommend me an alternative word...
2022/05/16
[ "https://ell.stackexchange.com/questions/315201", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/893/" ]
You can just cut the sentence a little: > > But news media is using it to score political points. > > > If you want to keep the original structure you can call it a **tool**: > > But news media is using it as a tool to score political points. > > > *Tool* itself is neutral here. The force of the sentences a...
You could say "But news media is using it as their **puppet** to score political point".
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
**Swift 3** - Useful `UIView` extension when you need to round specific corners of some views: ``` extension UIView { func round(corners: UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let mask = CA...
> > iOS 11+ Only | You can check iOS usage stats [here](https://developer.apple.com/support/app-store/) > > > Explanation =========== Since the `CACornerMask` rawValue is an `UInt` you know that a `CACornerMask` *rawValue* is the sum of each `CACornerMask.Element` *rawValue* More specifically: * TopLeft (`layer...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
In summary, you can create pretty extension like this: ``` extension UIView { func roundCorners(_ corners: UIRectCorner, radius: Double) { let maskPath = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let shape = CAShapeLayer() ...
One simple hack could be as following. Take views like below example in image. **Red View** will have rounded corners and **Yellow View** (inside Red View) will prevent the corners to be rounded [![enter image description here](https://i.stack.imgur.com/PdCxM.png)](https://i.stack.imgur.com/PdCxM.png) Now write below...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
In **Swift 2.3** you could do so by ``` let maskPath = UIBezierPath(roundedRect: anyView.bounds, byRoundingCorners: [.BottomLeft, .BottomRight], cornerRadii: CGSize(width: 10.0, height: 10.0)) let shape = CAShapeLayer() shape.path = maskPath.CGPath view.layer.mask = shape ``` --- In **Objec...
Here is what you do in **Swift 2.0** ``` var maskPath = UIBezierPath(roundedRect: anyView.bounds, byRoundingCorners: [.BottomLeft, .BottomRight], cornerRadii: CGSize(width: 10.0, height: 10.0)) ```
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
**Swift 4+, iOS 11+** If you already have a `UIView` named `myView` referenced as an `IBOutlet`, try adding the following two lines in `ViewDidLoad()` or wherever it's being loaded: ``` myView.layer.cornerRadius = 10 myView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] ``` You can change the ar...
In summary, you can create pretty extension like this: ``` extension UIView { func roundCorners(_ corners: UIRectCorner, radius: Double) { let maskPath = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let shape = CAShapeLayer() ...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
In **Swift 2.3** you could do so by ``` let maskPath = UIBezierPath(roundedRect: anyView.bounds, byRoundingCorners: [.BottomLeft, .BottomRight], cornerRadii: CGSize(width: 10.0, height: 10.0)) let shape = CAShapeLayer() shape.path = maskPath.CGPath view.layer.mask = shape ``` --- In **Objec...
```swift extension CACornerMask { public static var leftBottom : CACornerMask { get { return .layerMinXMaxYCorner}} public static var rightBottom : CACornerMask { get { return .layerMaxXMaxYCorner}} public static var leftTop : CACornerMask { get { return .layerMaxXMinYCorner}} public stat...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
> > iOS 11+ Only | You can check iOS usage stats [here](https://developer.apple.com/support/app-store/) > > > Explanation =========== Since the `CACornerMask` rawValue is an `UInt` you know that a `CACornerMask` *rawValue* is the sum of each `CACornerMask.Element` *rawValue* More specifically: * TopLeft (`layer...
**Swift 4:** ``` let maskPath = UIBezierPath( roundedRect: view.bounds, byRoundingCorners: [.allCorners], cornerRadii: CGSize(width: 10.0, height: 10.0) ) let shape = CAShapeLayer() shape.path = maskPath.cgPath view.layer.mask = shape ```
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
Update: See [this answer](https://stackoverflow.com/a/50396485/308315) below for Swift 4 / iOS 11 which is much, much easier --- Here's a quick Swift 3 extension you can use to do rounding and optional borders. Note: if you're using autolayout, you may need to call this in one of the view lifecycle callbacks like `v...
In summary, you can create pretty extension like this: ``` extension UIView { func roundCorners(_ corners: UIRectCorner, radius: Double) { let maskPath = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let shape = CAShapeLayer() ...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
**Swift 5:** For top-left and top-right round corners. ``` yourView.layer.cornerRadius = 12 yourView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] ```
Objective-C version of iWasRobbed's answer: UIView+RoundCorners.h ``` #import <UIKit/UIKit.h> @interface UIView (RoundCorners) /** Rounds the given set of corners to the specified radius - parameter corners: Corners to round - parameter radius: Radius to round to */ - (void)roundCorners:(UIRectCorner)corners ...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
Up-to-date for 2021 ... ======================= Please note that syntax/systems have changed a lot since this question was asked a long time ago! [![enter image description here](https://i.stack.imgur.com/DFlsB.png)](https://i.stack.imgur.com/DFlsB.png) ``` import UIKit @IBDesignable class RoundedEnds: UIView { ...
Updated iWasRobbed's answer to work with the Swift 3.0 GM version: ``` import UIKit extension UIView { /** Rounds the given set of corners to the specified radius - parameter corners: Corners to round - parameter radius: Radius to round to */ func round(corners: UIRectCorner, radius: CG...
29,618,765
This is my issue: I have 3 forms: * Form fParent * Form fChild * Form OpenForm I want that When I click a button on Form fChild, it shows Form OpenFormand and hides Form fParentand Form fChild. How can I do that? Please help me.
2015/04/14
[ "https://Stackoverflow.com/questions/29618765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4162835/" ]
> > iOS 11+ Only | You can check iOS usage stats [here](https://developer.apple.com/support/app-store/) > > > Explanation =========== Since the `CACornerMask` rawValue is an `UInt` you know that a `CACornerMask` *rawValue* is the sum of each `CACornerMask.Element` *rawValue* More specifically: * TopLeft (`layer...
One simple hack could be as following. Take views like below example in image. **Red View** will have rounded corners and **Yellow View** (inside Red View) will prevent the corners to be rounded [![enter image description here](https://i.stack.imgur.com/PdCxM.png)](https://i.stack.imgur.com/PdCxM.png) Now write below...
926,721
I would be very grateful if someone can help me with the following assignment: I'm given an $n\times n$ matrix $A$. If $A \neq I,0$ and $A = A^2$, I need to prove that $\lambda=0$ and $\lambda=1$ are $A$'s eigenvalues and that they are $A$'s only eigenvalues.
2014/09/10
[ "https://math.stackexchange.com/questions/926721", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175107/" ]
Suppose $\;0\neq v\in V\; $ is an eigenvector of $\;A\;$with eigenvalue $\;\lambda\;$ , then $$\lambda v= Av=A^2v=A(\lambda v)=\lambda Av=\lambda^2v$$ So $$(\lambda^2-\lambda)v=0\implies \lambda^2=\lambda\iff \lambda=0,1$$ $\;A\;$ is a zero of $\;x^2-x\;$ , which means this is the matrix's minimal polynomial (why?)...
Suppose $A$ were invertible. Then, $$A^2 = A \implies A^2 \cdot A^{-1} = A\cdot A^{-1} \implies A = I,$$ contrary to our hypothesis. Therefore, $A$ is not invertible and so $\det A = 0$. Since the determinant is the product of eigenvalues, $A$ must have $0$ as an eigenvalue. Suppose $\lambda = 0$ were the only eigenva...
25,661,580
I've got a list of daily values ordered into a list of dicts like so: ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 0, 'b': 0.5, 'c': 2, 'notes': 'high ...
2014/09/04
[ "https://Stackoverflow.com/questions/25661580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80460/" ]
``` {p:sum(map(lambda x:x[p],vals))/len(vals) for p in ['a','b','c']} ``` **output:** ``` {'a': 5, 'c': 88, 'b': 15.143333333333333} ```
This might be slightly longer than Elisha's answer, but there are less intermediate data structures, hence it *might* be faster: ``` KEYS = ['a', 'b', 'c'] def sum_and_count(sums_and_counts, item, key): prev_sum, prev_count = sums_and_counts.get(key, (0,0)) # using get to have a fall-back if there is nothing in o...
25,661,580
I've got a list of daily values ordered into a list of dicts like so: ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 0, 'b': 0.5, 'c': 2, 'notes': 'high ...
2014/09/04
[ "https://Stackoverflow.com/questions/25661580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80460/" ]
``` {p:sum(map(lambda x:x[p],vals))/len(vals) for p in ['a','b','c']} ``` **output:** ``` {'a': 5, 'c': 88, 'b': 15.143333333333333} ```
If you have multiple month's data, Pandas will make your life a lot easier: ``` df = pandas.DataFrame(vals) df.date = [pandas.datetools.parse(d, dayfirst=True) for d in df.date] df.set_index('date', inplace=True) means = df.resample('m', how='mean') ``` Results in: ``` a b c date ...
25,661,580
I've got a list of daily values ordered into a list of dicts like so: ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 0, 'b': 0.5, 'c': 2, 'notes': 'high ...
2014/09/04
[ "https://Stackoverflow.com/questions/25661580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80460/" ]
``` {p:sum(map(lambda x:x[p],vals))/len(vals) for p in ['a','b','c']} ``` **output:** ``` {'a': 5, 'c': 88, 'b': 15.143333333333333} ```
As you want to calculate average by month(Here considering the date format in 'dd-mm-yyyy'): ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 20, 'b': 0.5,...
25,661,580
I've got a list of daily values ordered into a list of dicts like so: ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 0, 'b': 0.5, 'c': 2, 'notes': 'high ...
2014/09/04
[ "https://Stackoverflow.com/questions/25661580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80460/" ]
This might be slightly longer than Elisha's answer, but there are less intermediate data structures, hence it *might* be faster: ``` KEYS = ['a', 'b', 'c'] def sum_and_count(sums_and_counts, item, key): prev_sum, prev_count = sums_and_counts.get(key, (0,0)) # using get to have a fall-back if there is nothing in o...
If you have multiple month's data, Pandas will make your life a lot easier: ``` df = pandas.DataFrame(vals) df.date = [pandas.datetools.parse(d, dayfirst=True) for d in df.date] df.set_index('date', inplace=True) means = df.resample('m', how='mean') ``` Results in: ``` a b c date ...
25,661,580
I've got a list of daily values ordered into a list of dicts like so: ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 0, 'b': 0.5, 'c': 2, 'notes': 'high ...
2014/09/04
[ "https://Stackoverflow.com/questions/25661580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80460/" ]
As you want to calculate average by month(Here considering the date format in 'dd-mm-yyyy'): ``` vals = [ {'date': '1-1-2014', 'a': 10, 'b': 33.5, 'c': 82, 'notes': 'high repeat rate'}, {'date': '2-1-2014', 'a': 5, 'b': 11.43, 'c': 182, 'notes': 'normal operations'}, {'date': '3-1-2014', 'a': 20, 'b': 0.5,...
If you have multiple month's data, Pandas will make your life a lot easier: ``` df = pandas.DataFrame(vals) df.date = [pandas.datetools.parse(d, dayfirst=True) for d in df.date] df.set_index('date', inplace=True) means = df.resample('m', how='mean') ``` Results in: ``` a b c date ...
43,146,388
```js import React, { Component } from 'react'; let _ = require('lodash'); import {bindActionCreators} from "redux"; import {connect} from 'react-redux'; import {fetchedBeaconsEdit} from '../../actions/'; import {editBeacon} from '../../actions/index'; // TODO - come up with a decent name class InfoRow exten...
2017/03/31
[ "https://Stackoverflow.com/questions/43146388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7645971/" ]
This is correct, because, `scanf()` returns number of successfully matched and converted elements. Considering proper input in your case, every time your input passes the conversion, so you get to see the value 1. Point to note, `scanf()` **does not return** the scanned value itself, it stores the value in the passed ...
The return type of scanf is to indicate if it successfully read an integer. This will do what you're expecting ``` #include <stdio.h> int main() { int days = 0; scanf("%d", &days); printf("%d", days); return 0; } ```
34,072,768
I am creating a column family in Cassandra and I expect the column order to match the one I am specifying in the create clause. This ``` CREATE TABLE cf.mycf ( timestamp timestamp, id text, score int, type text, publisher_id text, embed_url text, PRIMARY KEY (timestamp, id, score) ) WITH b...
2015/12/03
[ "https://Stackoverflow.com/questions/34072768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143013/" ]
Looks like there is no such thing as fields order in cassandra. ``` The others columns are displayed in alphabetical order by Cassandra. ``` <http://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_compound_keys_c.html>
You should make a clear distinction on how *you* want the data to be presented and how it is effectively presented to you. Moreover, you should not rely on the ordinal position of the fields but only on their names. In order to be efficient, and against your will (you specified an order to the columns when you modeled...
34,072,768
I am creating a column family in Cassandra and I expect the column order to match the one I am specifying in the create clause. This ``` CREATE TABLE cf.mycf ( timestamp timestamp, id text, score int, type text, publisher_id text, embed_url text, PRIMARY KEY (timestamp, id, score) ) WITH b...
2015/12/03
[ "https://Stackoverflow.com/questions/34072768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143013/" ]
Looks like there is no such thing as fields order in cassandra. ``` The others columns are displayed in alphabetical order by Cassandra. ``` <http://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_compound_keys_c.html>
Keep in mind that the rendering of the CQL string in DESCRIBE in cqlsh is just a [function call in the python driver](https://github.com/datastax/python-driver/blob/806e0b0021ca283842ea7ce48f27305725658e3b/cassandra/metadata.py#L1150) iterating over the metadata. It has nothing to do with how C\* stores or sends its re...
34,072,768
I am creating a column family in Cassandra and I expect the column order to match the one I am specifying in the create clause. This ``` CREATE TABLE cf.mycf ( timestamp timestamp, id text, score int, type text, publisher_id text, embed_url text, PRIMARY KEY (timestamp, id, score) ) WITH b...
2015/12/03
[ "https://Stackoverflow.com/questions/34072768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143013/" ]
You should make a clear distinction on how *you* want the data to be presented and how it is effectively presented to you. Moreover, you should not rely on the ordinal position of the fields but only on their names. In order to be efficient, and against your will (you specified an order to the columns when you modeled...
Keep in mind that the rendering of the CQL string in DESCRIBE in cqlsh is just a [function call in the python driver](https://github.com/datastax/python-driver/blob/806e0b0021ca283842ea7ce48f27305725658e3b/cassandra/metadata.py#L1150) iterating over the metadata. It has nothing to do with how C\* stores or sends its re...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
Here's Roman B's answer in Swift 2: ``` for view in tableView.subviews { if view is UIScrollView { (view as? UIScrollView)!.delaysContentTouches = false break } } ```
This is a **Swift** version of Raphaël Pinto's answer above. Don't forget to upvote him too :) ``` override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { super.touchesBegan(touches, withEvent: event) NSOperationQueue.mainQueue().addOperationWithBlock { () -> Void in self.highlighted = true } } ...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
I tried to add this to the accepted answer but it never went through. This is a much safer way of turning off the cells delaysContentTouches property as it does not look for a specific class, but rather anything that responds to the selector. In Cell: ``` for (id obj in self.subviews) { if ([obj respondsToSelect...
What I did to solve the problem was a category of UIButton using the following code : ``` - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; [NSOperationQueue.mainQueue addOperationWithBlock:^{ self.highlighted = YES; }]; } - (void) touchesCancel...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
Here's Roman B's answer in Swift 2: ``` for view in tableView.subviews { if view is UIScrollView { (view as? UIScrollView)!.delaysContentTouches = false break } } ```
Solution in Swift, iOS8 only (needs the extra work on each of the cells for iOS7): ``` // // NoDelayTableView.swift // DivineBiblePhone // // Created by Chris Hulbert on 30/03/2015. // Copyright (c) 2015 Chris Hulbert. All rights reserved. // // This solves the delayed-tap issue on buttons on cells. import UIKit...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
The accepted answer did not work at some "taps" for me . Finally I add the bellow code in a uibutton category(/subclass),and it works a hundred percent. ``` - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { self.backgroundColor = [UIColor greenColor]; [UIView animateWithDuration:0.05 delay:0 options...
In Swift 3 this UIView extension can be used on the UITableViewCell. Preferably in the `cellForRowAt` method. ``` func removeTouchDelayForSubviews() { for subview in subviews { if let scrollView = subview as? UIScrollView { scrollView.delaysContentTouches = false } else { su...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
For a solution that works in both iOS7 and iOS8, create a custom `UITableView` subclass and custom `UITableViewCell` subclass. Use this sample `UITableView`'s `initWithFrame:` ``` - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // iterate over all the UITableVi...
That solution for me doesn't work, I **fixed** subclassing TableView and implementing these two methods ``` - (instancetype)initWithCoder:(NSCoder *)coder{ self = [super initWithCoder:coder]; if (self) { for (id obj in self.subviews) { if ([obj respondsToSelector:@selector(setDelaysContentTouches:)]){...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
Solution in Swift, iOS8 only (needs the extra work on each of the cells for iOS7): ``` // // NoDelayTableView.swift // DivineBiblePhone // // Created by Chris Hulbert on 30/03/2015. // Copyright (c) 2015 Chris Hulbert. All rights reserved. // // This solves the delayed-tap issue on buttons on cells. import UIKit...
That solution for me doesn't work, I **fixed** subclassing TableView and implementing these two methods ``` - (instancetype)initWithCoder:(NSCoder *)coder{ self = [super initWithCoder:coder]; if (self) { for (id obj in self.subviews) { if ([obj respondsToSelector:@selector(setDelaysContentTouches:)]){...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
Since iOS 8 we need to apply the same technique to UITableView subviews (table contains a hidden UITableViewWrapperView scroll view). There is no need iterate UITableViewCell subviews anymore. ``` for (UIView *currentView in tableView.subviews) { if ([currentView isKindOfClass:[UIScrollView class]]) { ((UI...
That solution for me doesn't work, I **fixed** subclassing TableView and implementing these two methods ``` - (instancetype)initWithCoder:(NSCoder *)coder{ self = [super initWithCoder:coder]; if (self) { for (id obj in self.subviews) { if ([obj respondsToSelector:@selector(setDelaysContentTouches:)]){...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
Slightly modified version of [Chris Harrison's answer](https://stackoverflow.com/a/28066210/649379). Swift 2.3: ``` class HighlightButton: UIButton { override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { super.touchesBegan(touches, withEvent: event) NSOperationQueue.mainQue...
I wrote a category extension on `UITableViewCell` to make this issue simple to address. It does basically the same thing as the accepted answer except I walk up the view hierarchy (as opposed to down) from the `UITableViewCell contentView`. I considered a fully "automagic" solution that would make all cells added to a...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
What I did to solve the problem was a category of UIButton using the following code : ``` - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; [NSOperationQueue.mainQueue addOperationWithBlock:^{ self.highlighted = YES; }]; } - (void) touchesCancel...
In Swift 3 this UIView extension can be used on the UITableViewCell. Preferably in the `cellForRowAt` method. ``` func removeTouchDelayForSubviews() { for subview in subviews { if let scrollView = subview as? UIScrollView { scrollView.delaysContentTouches = false } else { su...
19,256,996
I've looked at a ton of posts on similar things, but none of them quite match or fix this issue. Since iOS 7, whenever I add a `UIButton` to a `UITableViewCell` or even to the footerview it works "fine", meaning it receives the target action, but it doesn't show the little highlight that normally happens as you tap a `...
2013/10/08
[ "https://Stackoverflow.com/questions/19256996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904355/" ]
``` - (void)viewDidLoad { [super viewDidLoad]; for (id view in self.tableView.subviews) { // looking for a UITableViewWrapperView if ([NSStringFromClass([view class]) isEqualToString:@"UITableViewWrapperView"]) { // this test is necessary for safety and because a "U...
Solution in Swift, iOS8 only (needs the extra work on each of the cells for iOS7): ``` // // NoDelayTableView.swift // DivineBiblePhone // // Created by Chris Hulbert on 30/03/2015. // Copyright (c) 2015 Chris Hulbert. All rights reserved. // // This solves the delayed-tap issue on buttons on cells. import UIKit...
48,021,400
so if I put the keywords.. return type:int, parameter:String (something like this) it show results such as void int Integer.parseInt(String) Hope I could explain what I'm looking for.
2017/12/29
[ "https://Stackoverflow.com/questions/48021400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215388/" ]
Assuming * *Array* items are sorted (if not, you need to sort them) * `arr2` doesn't contain any element which is not part of `arr1` Use `map` to iterate and check if `index` of each `item` is not `-1` ``` var output = arr1.map( s => arr2.indexOf( s ) != -1 ? s : "--" ); ``` **Demo** ```js var arr1 = ["CRS02","CR...
First of all, it seems like you have filled the arrays with vars. Strings in JavaScript start and end with single (`''`) or double (`""`) quotes. I will assume they are strings in terms of simplicity. You don't need two loops for that. Just use a `step` counter: **Note**: The aim of this solution is to be readable, i...
48,021,400
so if I put the keywords.. return type:int, parameter:String (something like this) it show results such as void int Integer.parseInt(String) Hope I could explain what I'm looking for.
2017/12/29
[ "https://Stackoverflow.com/questions/48021400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215388/" ]
Assuming * *Array* items are sorted (if not, you need to sort them) * `arr2` doesn't contain any element which is not part of `arr1` Use `map` to iterate and check if `index` of each `item` is not `-1` ``` var output = arr1.map( s => arr2.indexOf( s ) != -1 ? s : "--" ); ``` **Demo** ```js var arr1 = ["CRS02","CR...
```js var arr1 = ["CRS02","CRS04","CRS03","CRS01","CRS05"]; var arr2 = ["CRS02","CRS03","CRS05"]; var str = ""; for(var i = 0; i < arr1.length; i++){ if(arr2.indexOf(arr1[i]) >= 0){ str += arr1[i] + ","; } else{ str += "--"+","; } } str = str.substring(0,(str.length-1)); console.log(str); `...
48,021,400
so if I put the keywords.. return type:int, parameter:String (something like this) it show results such as void int Integer.parseInt(String) Hope I could explain what I'm looking for.
2017/12/29
[ "https://Stackoverflow.com/questions/48021400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215388/" ]
Assuming * *Array* items are sorted (if not, you need to sort them) * `arr2` doesn't contain any element which is not part of `arr1` Use `map` to iterate and check if `index` of each `item` is not `-1` ``` var output = arr1.map( s => arr2.indexOf( s ) != -1 ? s : "--" ); ``` **Demo** ```js var arr1 = ["CRS02","CR...
Try the following: ``` var arr1 = ["CRS02","CRS04","CRS03","CRS01","CRS05"]; var arr2 = ["CRS02","CRS03","CRS05"]; function getContainsString(arr1, arr2) { return arr1.reduce(function(result, el) { return result + (arr2.indexOf(el) < 0 ? "--" : el) + ","; }, "").slice(0, -1); } console.log(getContai...
48,021,400
so if I put the keywords.. return type:int, parameter:String (something like this) it show results such as void int Integer.parseInt(String) Hope I could explain what I'm looking for.
2017/12/29
[ "https://Stackoverflow.com/questions/48021400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215388/" ]
Assuming * *Array* items are sorted (if not, you need to sort them) * `arr2` doesn't contain any element which is not part of `arr1` Use `map` to iterate and check if `index` of each `item` is not `-1` ``` var output = arr1.map( s => arr2.indexOf( s ) != -1 ? s : "--" ); ``` **Demo** ```js var arr1 = ["CRS02","CR...
If your data sets are large and you don't want to use `indexOf` repeatedly in the loop, you can use a `Set` to quickly check the contents of `arr2`: ```js const arr1 = ["CRS02","CRS04","CRS03","CRS01","CRS05"]; const set2 = new Set(["CRS02","CRS03","CRS05"]); console.log( arr1 .map(x => set2.has(x) ? x : "-...
48,021,400
so if I put the keywords.. return type:int, parameter:String (something like this) it show results such as void int Integer.parseInt(String) Hope I could explain what I'm looking for.
2017/12/29
[ "https://Stackoverflow.com/questions/48021400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215388/" ]
Assuming * *Array* items are sorted (if not, you need to sort them) * `arr2` doesn't contain any element which is not part of `arr1` Use `map` to iterate and check if `index` of each `item` is not `-1` ``` var output = arr1.map( s => arr2.indexOf( s ) != -1 ? s : "--" ); ``` **Demo** ```js var arr1 = ["CRS02","CR...
You can use `array#map` to iterate through `arr1` and use `array#includes` to test the existence of value in `arr2`. ```js var arr1 = ["CRS02","CRS04","CRS03","CRS01","CRS05"], arr2 = ["CRS02","CRS03","CRS05"], result = arr1.map(v => arr2.includes(v) ? v :'--') .join(','); console.log(resu...
28,920,739
people I have a problem I want to read from a file and use and fetch some parts of the file like below. This is whats inside the file but I want to fetch the names. This file is used by my server and if a player logs in the server then the list of names get bigger. But I have no clue how to do it.. and I really want t...
2015/03/07
[ "https://Stackoverflow.com/questions/28920739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3866202/" ]
``` String myString = "myString"; int maxLength = 3; if (myString.length() > maxLength) myString = myString.substring(0, maxLength); ``` Result will be "myS"
"I was searching around on the web for a manual code to count the amount of characters within a string, and then to a further extent cut off any excess characters of the string." Count amount of characters within a string: ``` int length = stringName.length(); ``` Cutting off extra characters of the string ``` in...
63,251
(This doesn't affect me personally but is something that came up which I'm curious about. I'm not sure what to tag it with) Could an employer ask "me" to change my hours for that week so that I'd do the jury duty in the normal court hours and an "evening shift" instead of my normal work hours? (6-midnight instead of 8...
2016/03/08
[ "https://workplace.stackexchange.com/questions/63251", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/47059/" ]
In the US this depends on company policy. Some companies only give you time off for the conflicting hours, and tell you to request the minor daily stipend the government offers to partly reimburse you for your time. Some pay the difference between that stipend and your normal salary. Others offer other arrangements. F...
Depends what country you are in, but if you are in the UK you can contact the Jury Central Summoning Bureau. > > The Jury Central Summoning Bureau can: > > > * give advice about your summons or jury service > * arrange a visit to the court for you, eg if you’re disabled and want to see the facilities > > > **Jury...
63,251
(This doesn't affect me personally but is something that came up which I'm curious about. I'm not sure what to tag it with) Could an employer ask "me" to change my hours for that week so that I'd do the jury duty in the normal court hours and an "evening shift" instead of my normal work hours? (6-midnight instead of 8...
2016/03/08
[ "https://workplace.stackexchange.com/questions/63251", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/47059/" ]
In the US this depends on company policy. Some companies only give you time off for the conflicting hours, and tell you to request the minor daily stipend the government offers to partly reimburse you for your time. Some pay the difference between that stipend and your normal salary. Others offer other arrangements. F...
In virtually every country in the world that uses juries, employers are obliged to give you time off for jury duty. Time off means time off - it does not mean working at a different time. While your company could *ask* you to come in after your jury duty hours for an emergency, they couldn't compel you. And any hours y...
26,167,150
I have a JSONArray which I am iterating to populate my Map as shown below. My `ppJsonArray` will have data like this - ``` [693,694,695,696,697,698,699,700,701,702] ``` Below is my code which is having issues with thread safety as my static analysis tool complained - ``` Map<Integer, Integer> m = new HashMap<Intege...
2014/10/02
[ "https://Stackoverflow.com/questions/26167150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2809564/" ]
The above code is not thread safe. Does it need to be thread safe? (i.e., Is partitionsToNodeMap used by more than one thread? Could more than one thread run this routine? or could thread A thread update partitionsToNodeMap in some other routine while thread B runs this routine?) If you answered "yes" to any of those...
Your static analysis tool is confused because what you're doing looks like a classic race condition. ``` Map<Integer, Integer> tempMap = partitionsToNodeMap.get("PRIMARY"); // GET if (tempMap != null) { // CHECK tempMap.putAll(m); } else { tempMap = m; } partitionsToNodeMap.put("PRIMARY", tempMap); // PUT ...
39,456,448
I have 3 files and want to print lines that are a combination of the same line from each file. The files can have any number of lines. How can I iterate over three files in parallel? protocol.txt ``` http ftp sftp ``` website.txt ``` facebook yahoo gmail ``` port.txt ``` 23 45 56 ``` Expected output: ``` Pro...
2016/09/12
[ "https://Stackoverflow.com/questions/39456448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3611969/" ]
Here is my version: ``` import os.path directory = "C:/Users/3 files read" with open(os.path.join(directory, "protocol.txt"), 'r') as f1,\ open(os.path.join(directory, "website.txt"), 'r') as f2,\ open(os.path.join(directory, "port.txt"), 'r') as f3: for l1, l2, l3 in zip(f1, f2, f3): print "P...
This will work: ``` with open(...) as file1, open(...) as file2, open(...) as file3: for l1, l2, l3 in zip(file1, file2, file3): print("prot %s website %s port %s" % (l1.rstrip(),l2.rstrip(),l3.rstrip())) ```
12,394,348
Is quoting every part of a SELECT statement deprecated T-SQL syntax? ``` SELECT "A", "B", "C" FROM "database"."table" where "column" = @p2 ``` This is syntax being used by MS Access to query against a SQL Server instance. I do not know what version of Access is being used.
2012/09/12
[ "https://Stackoverflow.com/questions/12394348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2184/" ]
As far as I know it is not. Microsoft SQL 2012 still supports using double quotes in select statements see [here](http://msdn.microsoft.com/en-us/library/ms174393.aspx)
This sentence is working, BUT only if A, B and C are columns: ``` SELECT "A", "B", "C" FROM "database"."table" where "column" = @p2 ``` If those are values like varchar, you have to use 'A','B','C'. And the "database"."table" is not well defined. It should be `"database"."schemaName"."table"`. (Usually schemaName...
67,077,518
Hoping someone could help me out with something here, I'm trying to split a long string w/ numbers and card suits so that it displays nicely by number. ```none AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD...
2021/04/13
[ "https://Stackoverflow.com/questions/67077518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12759155/" ]
Actually, in your case, you want to split on the space following a **D**, so `split("(?<=D) ")` will do: ```java String input = "AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD"; String[] ranks = input.split...
The simplest way is to include a newline character `\n` after each value like this: ``` for(int i = 1; i <=14; i++){ for(int j = 0; j < suits.length; j++){ // your stuff } cards = cards + '\n'; } ``` Note however, that concatenating to a `String` in a loop is usually discouraged in Java, because it require...
67,077,518
Hoping someone could help me out with something here, I'm trying to split a long string w/ numbers and card suits so that it displays nicely by number. ```none AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD...
2021/04/13
[ "https://Stackoverflow.com/questions/67077518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12759155/" ]
Actually, in your case, you want to split on the space following a **D**, so `split("(?<=D) ")` will do: ```java String input = "AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD"; String[] ranks = input.split...
A possible solution is that you will first split your string by space `(" ")`. Then loop through the resulting array, keeping track of the latest "starting character" (eg. 2). Print the new item as long as it `startsWith()` that character. If it doesn't, print a new line and change the "starting character" (eg. 3)
67,077,518
Hoping someone could help me out with something here, I'm trying to split a long string w/ numbers and card suits so that it displays nicely by number. ```none AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD...
2021/04/13
[ "https://Stackoverflow.com/questions/67077518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12759155/" ]
Actually, in your case, you want to split on the space following a **D**, so `split("(?<=D) ")` will do: ```java String input = "AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD"; String[] ranks = input.split...
You may have to bend this if the format changes, but in your current example printing a new line after 4 items is just fine: ``` final String testCase = "AS AC AH AD 2S 2C 2H 2D 3S 3C 3H 3D 4S 4C 4H 4D 5S 5C 5H 5D 6S 6C 6H 6D 7S 7C 7H 7D 8S 8C 8H 8D 9S 9C 9H 9D 10S 10C 10H 10D JS JC JH JD QS QC QH QD KS KC KH KD"; fin...
3,703,726
So I have $(x^4 + 2x^3 +3x^2 +2x +1) + I$ and I'm wanting to show that this is not an integral domain. I know that I have to use the principal ideal which is $x^3 + 1$ and somehow get it into a form that involves the principal ideal to show that it's not the integral domain but I'm not sure how to. Some guidance would ...
2020/06/03
[ "https://math.stackexchange.com/questions/3703726", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
The polynomial is reducible over $\Bbb F\_2$, namely we have $$ f=x^4 + 2x^3 +3x^2 +2x +1=(x^2 + x + 1)^2. $$ Hence there are zero divisors and the quotient ring $\Bbb F\_2[x]/(f)$ is not an integral domain. For the same reason, $$ \Bbb F\_2[x]/(x^3+1) $$ has zero divisors, i.e., because $x^3+1$ is reducible over $\Bbb...
All you have to check is whether the polynomial you wrote is irreducible or not. The polynomial you wrote modulo $\mathbb{F}\_2$ is $x^4+x^2+1=(x^2+x+1)^2$, obviously i used the “freshman’s dream”.
68,105,405
I have case statement below as ``` count(CASE WHEN time_lag / 10000 >= 0 AND time_lag / 1000 <= 50 THEN 1 END) AS [0 - 50] ``` but am getting error on syntax error, is there proper way to divide in case statement? thanks
2021/06/23
[ "https://Stackoverflow.com/questions/68105405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8797830/" ]
Use the `vh` relative unit. `vh` stands for Viewport Height and can be used like so: ```css html, body { height: 100vh; } ``` This will tell the browser to use **100%** of the **viewport height**. There is also a `vw`, which controls the width relative to the viewport. Read more on relative units on the [MDN page...
You should use this code for the `body`: ```css body { margin: 0; height: 100vh; } ``` You can learn more about units here: <https://www.w3schools.com/cssref/css_units.asp>
68,105,405
I have case statement below as ``` count(CASE WHEN time_lag / 10000 >= 0 AND time_lag / 1000 <= 50 THEN 1 END) AS [0 - 50] ``` but am getting error on syntax error, is there proper way to divide in case statement? thanks
2021/06/23
[ "https://Stackoverflow.com/questions/68105405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8797830/" ]
Use the `vh` relative unit. `vh` stands for Viewport Height and can be used like so: ```css html, body { height: 100vh; } ``` This will tell the browser to use **100%** of the **viewport height**. There is also a `vw`, which controls the width relative to the viewport. Read more on relative units on the [MDN page...
Set the heights for the header, section and footer with height: ...vh. vh is the shortcut for viewport height. ``` ... header { display: flex; justify-content: center; align-items: center; height: 20vh; background-color: blue; padding: 30px 0; font-size: 30px; } section { height: 70vh...
68,105,405
I have case statement below as ``` count(CASE WHEN time_lag / 10000 >= 0 AND time_lag / 1000 <= 50 THEN 1 END) AS [0 - 50] ``` but am getting error on syntax error, is there proper way to divide in case statement? thanks
2021/06/23
[ "https://Stackoverflow.com/questions/68105405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8797830/" ]
Use the `vh` relative unit. `vh` stands for Viewport Height and can be used like so: ```css html, body { height: 100vh; } ``` This will tell the browser to use **100%** of the **viewport height**. There is also a `vw`, which controls the width relative to the viewport. Read more on relative units on the [MDN page...
I think adding a wrapper would solve the problem! The final code is like below: ```html <style> * { box-sizing: border-box; border: 0; } .wrapper { display: flex; height:100%; flex-direction: column; } .wrapper > *{ display: flex; flex:1; } header{ background-color: ...
44,303
I cannot seem to figure out how to remove the Headers/Footers from *printed* Firefox pages. Could someone please show me the way? (I'm using Firefox 3.5.3.)
2009/09/20
[ "https://superuser.com/questions/44303", "https://superuser.com", "https://superuser.com/users/991/" ]
On the menu bar go to File → Print. In the dialog that comes up, on the bottom you should be able to select to not print those, like I did below. ![alt text](https://i.stack.imgur.com/qanss.png)
Just click File > Page Setup, then the second tab is "Margins & Header/Footer". You can change all the settings there to --blank--. ![alt text](https://i.stack.imgur.com/qFAdo.jpg)
56,532,235
Click on `ŞHOW / HIDE` several times. You'll see that after each click textarea becomes more and more higher. What is the reason and how to avoid this. I need the textarea always to fit the content. ```js $('#btna').on('click', function(){ $('#txa').hide() }); $('#btnb').on('click', function(){ $('#txa')...
2019/06/10
[ "https://Stackoverflow.com/questions/56532235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3044737/" ]
Please try this. ```js $('#btna').on('click', function(){ $('#txa').hide() }); $('#btnb').on('click', function(){ $('#txa').show() }); autosize(); function autosize(){ var text = $('#txa'); text.each(function(){ $(this).attr('rows',1); resize($(this)); }); text.on('inpu...
Here you go, the height manipulation was unnecessary. ```js $('#btna').on('click', function(){ $('#txa').hide() }); $('#btnb').on('click', function(){ $('#txa').show() }); ``` ```css #txa, #txb{ display:block; width:100%; resize:none; overflow:hidde; } ``` ```html <script src="https://cdnjs.cloudflare.co...
56,532,235
Click on `ŞHOW / HIDE` several times. You'll see that after each click textarea becomes more and more higher. What is the reason and how to avoid this. I need the textarea always to fit the content. ```js $('#btna').on('click', function(){ $('#txa').hide() }); $('#btnb').on('click', function(){ $('#txa')...
2019/06/10
[ "https://Stackoverflow.com/questions/56532235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3044737/" ]
Please try this. ```js $('#btna').on('click', function(){ $('#txa').hide() }); $('#btnb').on('click', function(){ $('#txa').show() }); autosize(); function autosize(){ var text = $('#txa'); text.each(function(){ $(this).attr('rows',1); resize($(this)); }); text.on('inpu...
Remove the following 2 lines from your script ``` let a = $('#txa').prop('scrollHeight'); $('#txa').height(a); ``` It still works and does not add an extra line in the textarea field.
62,001,013
I need to replace the salary status to `1` or `0` respectively if the salary is `greater than 50,000` or `less than or equal to 50,000` in a df. ![Here is the df:](https://i.stack.imgur.com/i0ksL.jpg) The DataFrame shape:30162\*13 I have tried this: ``` data2['SalStat']=data2['SalStat'].map({"less than or equal to ...
2020/05/25
[ "https://Stackoverflow.com/questions/62001013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11405742/" ]
You can try like below: ``` RuleFor(u => u) .Must(u => u.FirstPassword != u.SecondPassword) .WithMessage("Second password are not allow to same as first password."); ``` Test Result: [![enter image description here](https://i.stack.imgur.com/8E3ql.gif)](https://i.stack.imgur.com/8E3ql.gif)
``` RuleFor(x => x.FirstPassword) .NotEmpty().WithMessage(localizer["{PropertyName} must not be empty."]) .MinimumLength(8); RuleFor(x => x.SecondPassword) .NotEmpty().WithMessage(localizer["{PropertyName} must not be empty."]) .NotEqual(x => x.Password).WithMessage(localizer["{PropertyName} do not match."]); ```
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
Try this ``` $this->db->join('post_likes', "post_likes.user_id=$the_userid AND post_likes.post_id=post.id", 'left'); ``` or ``` $this->db->join('post_likes', 'post_likes.user_id="'.$the_userid.'" AND post_likes.post_id=post.id', 'left'); ``` Update: Define ``` $db['default']['_protect_iden...
try this one ``` $this->db->join('post_likes', 'post_likes.user_id="{$online_user}" AND post_likes.post_id=post.id', 'left'); ``` please let me know if you face any problem.
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
Try this ``` $this->db->join('post_likes', "post_likes.user_id=$the_userid AND post_likes.post_id=post.id", 'left'); ``` or ``` $this->db->join('post_likes', 'post_likes.user_id="'.$the_userid.'" AND post_likes.post_id=post.id', 'left'); ``` Update: Define ``` $db['default']['_protect_iden...
Dont use `$this->db->escape` ``` $this->db->join('post_likes', 'post_likes.user_id="'.$online_user.'" AND post_likes.post_id=post.id', 'left'); ```
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
You SHOULD not use the double quotes in SQL query: ``` $this->db->join('post_likes', "post_likes.user_id = $online_user AND post_likes.post_id=post.id", 'left'); ``` ### Update: This is a bug in the current CI stable version (fixed in v3.0-DEV), CI ActiveRecord methods (which doesn't implement really ActiveRecord) ...
Try this ``` $this->db->join('post_likes', "post_likes.user_id=$the_userid AND post_likes.post_id=post.id", 'left'); ``` or ``` $this->db->join('post_likes', 'post_likes.user_id="'.$the_userid.'" AND post_likes.post_id=post.id', 'left'); ``` Update: Define ``` $db['default']['_protect_iden...
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
You SHOULD not use the double quotes in SQL query: ``` $this->db->join('post_likes', "post_likes.user_id = $online_user AND post_likes.post_id=post.id", 'left'); ``` ### Update: This is a bug in the current CI stable version (fixed in v3.0-DEV), CI ActiveRecord methods (which doesn't implement really ActiveRecord) ...
try this one ``` $this->db->join('post_likes', 'post_likes.user_id="{$online_user}" AND post_likes.post_id=post.id', 'left'); ``` please let me know if you face any problem.
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
Simple solution would be to temporarily set the protect\_identifiers off before join query, like so: ``` $this->db->_protect_identifiers = false; ``` After making join query you could set it back to `true` Works for me in CodeIgniter version 2.1.2
try this one ``` $this->db->join('post_likes', 'post_likes.user_id="{$online_user}" AND post_likes.post_id=post.id', 'left'); ``` please let me know if you face any problem.
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
You SHOULD not use the double quotes in SQL query: ``` $this->db->join('post_likes', "post_likes.user_id = $online_user AND post_likes.post_id=post.id", 'left'); ``` ### Update: This is a bug in the current CI stable version (fixed in v3.0-DEV), CI ActiveRecord methods (which doesn't implement really ActiveRecord) ...
Dont use `$this->db->escape` ``` $this->db->join('post_likes', 'post_likes.user_id="'.$online_user.'" AND post_likes.post_id=post.id', 'left'); ```
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
Simple solution would be to temporarily set the protect\_identifiers off before join query, like so: ``` $this->db->_protect_identifiers = false; ``` After making join query you could set it back to `true` Works for me in CodeIgniter version 2.1.2
Dont use `$this->db->escape` ``` $this->db->join('post_likes', 'post_likes.user_id="'.$online_user.'" AND post_likes.post_id=post.id', 'left'); ```
18,207,873
I have an action on my controller that takes two parameters that should be captured when a form is posted: ``` [HttpPost] public ActionResult Index(MyModel model, FormAction action) ``` The idea is that the model data should be captured in `MyModel` and the button that the user pressed should be captured in `FormAct...
2013/08/13
[ "https://Stackoverflow.com/questions/18207873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417702/" ]
You SHOULD not use the double quotes in SQL query: ``` $this->db->join('post_likes', "post_likes.user_id = $online_user AND post_likes.post_id=post.id", 'left'); ``` ### Update: This is a bug in the current CI stable version (fixed in v3.0-DEV), CI ActiveRecord methods (which doesn't implement really ActiveRecord) ...
Simple solution would be to temporarily set the protect\_identifiers off before join query, like so: ``` $this->db->_protect_identifiers = false; ``` After making join query you could set it back to `true` Works for me in CodeIgniter version 2.1.2
52,637,338
I am using Python 3.6.5 64bit and the latest version of Selenium Webdriver and Google chromedriver. My IDE is Visual Studio Code. I have been able to locate and use every element I have needed of hundreds over multiple web automation projects. I often use the Chrome developer console to identify and test for valid Xpa...
2018/10/04
[ "https://Stackoverflow.com/questions/52637338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5759901/" ]
Have you tried finding a list of elements on the active page and seeing if any of those contain the element you are looking for? ``` tableHeaders = driver.find_elements_by_tag_name('th') ``` You should be able to navigate through tableHeaders and find the element where the Text value matches what you desire.
Good grief! I have tunnel vision... been staring at this screen for too long today. There were two calls, a hundred lines apart. I was trying the variations on the second call when in fact it was the first call above that was throwing the exception. It was there in front of me as obvious as the screens glaring back at ...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Much less detail than the excellent [post](https://cseducators.stackexchange.com/a/5730/104) by [Buffy](https://cseducators.stackexchange.com/users/1293), but directly to the question. Replace unit tests with validations and linters. Have the students create all content in distinct files: HTML, CSS, and JS. Any style...
For me, 60 is a very large class. Let me focus on a course design, extrapolated from other areas, in my case, the compiler course. The intent here is to make assessment feasible, rather than to say how to do it explicitly. I would have two projects for the course. The first is individual and lasts two weeks. It would...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
For me, 60 is a very large class. Let me focus on a course design, extrapolated from other areas, in my case, the compiler course. The intent here is to make assessment feasible, rather than to say how to do it explicitly. I would have two projects for the course. The first is individual and lasts two weeks. It would...
Assessing web dev courses at scale can be tricky because you have to consider the following: * ensure that the resulting web app **looks** as expected * all functionalities should work as expected with the **correct logic** * the **code quality** to make everything work should meet the industry standard With 60 stude...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
For me, 60 is a very large class. Let me focus on a course design, extrapolated from other areas, in my case, the compiler course. The intent here is to make assessment feasible, rather than to say how to do it explicitly. I would have two projects for the course. The first is individual and lasts two weeks. It would...
Another thought that comes to mind is that you can, to some extent, automate checking of web pages with [selenium](https://www.seleniumhq.org/). It would be a very large lift and your students would be forced to follow certain conventions in building their web pages but that may be an approach which could automate part...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
For me, 60 is a very large class. Let me focus on a course design, extrapolated from other areas, in my case, the compiler course. The intent here is to make assessment feasible, rather than to say how to do it explicitly. I would have two projects for the course. The first is individual and lasts two weeks. It would...
I think Buffy's answer is an excellent philosophy of how to solve this, but I would add a specific thing to it: dependency breaks. Back when I was learning Compiler Construction, we were supposed to develop a Pascal compiler in several steps, each building on the next bit. If you couldn't solve part A, you couldn't ev...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Much less detail than the excellent [post](https://cseducators.stackexchange.com/a/5730/104) by [Buffy](https://cseducators.stackexchange.com/users/1293), but directly to the question. Replace unit tests with validations and linters. Have the students create all content in distinct files: HTML, CSS, and JS. Any style...
Assessing web dev courses at scale can be tricky because you have to consider the following: * ensure that the resulting web app **looks** as expected * all functionalities should work as expected with the **correct logic** * the **code quality** to make everything work should meet the industry standard With 60 stude...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Much less detail than the excellent [post](https://cseducators.stackexchange.com/a/5730/104) by [Buffy](https://cseducators.stackexchange.com/users/1293), but directly to the question. Replace unit tests with validations and linters. Have the students create all content in distinct files: HTML, CSS, and JS. Any style...
Another thought that comes to mind is that you can, to some extent, automate checking of web pages with [selenium](https://www.seleniumhq.org/). It would be a very large lift and your students would be forced to follow certain conventions in building their web pages but that may be an approach which could automate part...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Much less detail than the excellent [post](https://cseducators.stackexchange.com/a/5730/104) by [Buffy](https://cseducators.stackexchange.com/users/1293), but directly to the question. Replace unit tests with validations and linters. Have the students create all content in distinct files: HTML, CSS, and JS. Any style...
I think Buffy's answer is an excellent philosophy of how to solve this, but I would add a specific thing to it: dependency breaks. Back when I was learning Compiler Construction, we were supposed to develop a Pascal compiler in several steps, each building on the next bit. If you couldn't solve part A, you couldn't ev...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Assessing web dev courses at scale can be tricky because you have to consider the following: * ensure that the resulting web app **looks** as expected * all functionalities should work as expected with the **correct logic** * the **code quality** to make everything work should meet the industry standard With 60 stude...
Another thought that comes to mind is that you can, to some extent, automate checking of web pages with [selenium](https://www.seleniumhq.org/). It would be a very large lift and your students would be forced to follow certain conventions in building their web pages but that may be an approach which could automate part...
5,728
I've been teaching Java and C# for years and I'll be picking up a web development (HTML, CSS, JS) course in the fall semester because our department is down a faculty member and won't be filling the position. I can run unit tests on Java and C# to make sure the code students are submitting is correct without an issue,...
2019/05/30
[ "https://cseducators.stackexchange.com/questions/5728", "https://cseducators.stackexchange.com", "https://cseducators.stackexchange.com/users/8104/" ]
Assessing web dev courses at scale can be tricky because you have to consider the following: * ensure that the resulting web app **looks** as expected * all functionalities should work as expected with the **correct logic** * the **code quality** to make everything work should meet the industry standard With 60 stude...
I think Buffy's answer is an excellent philosophy of how to solve this, but I would add a specific thing to it: dependency breaks. Back when I was learning Compiler Construction, we were supposed to develop a Pascal compiler in several steps, each building on the next bit. If you couldn't solve part A, you couldn't ev...
16,097,453
I have [data](http://dpaste.com/1064360/plain/) that contain 54 samples for each condition (x and y). I have computed the correlation the following way: ``` > dat <- read.table("http://dpaste.com/1064360/plain/",header=TRUE) > cor(dat$x,dat$y) [1] 0.2870823 ``` Is there a native way to produce SE of correlation in R...
2013/04/19
[ "https://Stackoverflow.com/questions/16097453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67405/" ]
I think that what you're looking for is simply the `cor.test()` function, which will return everything you're looking for except for the standard error of correlation. However, as you can see, the formula for that is very straightforward, and if you use `cor.test`, you have all the inputs required to calculate it. Us...
Can't you simply take the test statistic from the return value? Of course the test statistic is the estimate/se so you can calc se from just dividing the estimate by the tstat: Using `mydf` in the answer above: ``` r = cor.test(mydf$X, mydf$Y) tstat = r$statistic estimate = r$estimate estimate; tstat cor -0....
55,795,775
Please let us know how to remove "Microsoft Power BI" footer from the report while publishing to web. Please find the below snapshot. [![enter image description here](https://i.stack.imgur.com/XpbvZ.jpg)](https://i.stack.imgur.com/XpbvZ.jpg)
2019/04/22
[ "https://Stackoverflow.com/questions/55795775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10249366/" ]
You cannot, Power bi gives back an Iframe, and you have no control over it. If you want to have this control use power bi embedded instead.
Link Powerbi + &navContentPaneEnabled=false
38,854,968
I would like to (ab-)use Core Animation or even UIDynamics to generate animated values (floats) that I could use to control other parameters. E.g. Having an animation with an ease in, I would like to control a color with an 'eased' value.
2016/08/09
[ "https://Stackoverflow.com/questions/38854968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/624459/" ]
Core Animation can certainly do this for you. You need to create a `CALayer` subclass that has a new property you'd like to animate: ``` class CustomLayer: CALayer { @NSManaged var colorPercentage: Float override required init(layer: AnyObject) { super.init(layer: layer) if let layer = layer...
My best guess is to use [CADisplayLink](https://developer.apple.com/library/ios/documentation/QuartzCore/Reference/CADisplayLink_ClassRef/). See this [post](http://mokagio.github.io/tech-journal/2015/02/23/ios-animating-with-cadisplaylink.html). Changes of an animation are not observable by KVO.
375,774
[UPDATE] This issue seems to be fixed in 10.15.2. --- **Device, OS version and other background info:** * MacBook Pro Retina late-2013, Catalina 10.15.1 * FileVault is not enabled. * iCloud Desktop/Document syncing is not enabled. * Time Machine backup stored on an external drive; auto-backup is temporarily disable...
2019/11/22
[ "https://apple.stackexchange.com/questions/375774", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/18405/" ]
I have the same issue. My USBC hub is Deltaco USBC 1266. You probably don't need to reboot, just move the keyboard from one slot to another or move the whole dongle from one port to another. This usually resolves it for me. I had this problem when the computer was new in 2016. Whatever the OS was then. And I got it a...
I am using a 2019 Macbook Pro 13" with Mac OS 10.15.3 (Catalina). I have a Dell D6000 USB-C dock and a Dell P2419HC USB-C monitor that can act as a USB-C hub. With both of these docks/hubs, I have the issue where I will plug in the USB-C cable to the Macbook Pro 13" and sometimes the USB devices or monitors will be rec...
58,876,225
How to integrate screen time/ Parental control API in iOS app. Is screen time api available? I tried with MDM(Mobile device management) but I am unable to create the MDM CSR. As there is no option for this certificate on developer account. Please guide me if you have any solution. Basically I want to create an app havi...
2019/11/15
[ "https://Stackoverflow.com/questions/58876225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9858609/" ]
I did research and setting compiler flags solved the problem. Earlier they were blank and the way Xcode UI is I got confused how to edit them they looked disabled. So what you have to do is double tap on the side of the flags or press enter and add the following values as I had attached the screenshot below. [![ent...
`DEBUG` is the only default swift flag on a new project. You can create your own in your project build settings, `Other Swift Flags`. Otherwise: ``` #if DEBUG // This code will be run while installing from Xcode #else // This code will be run from AppStore, Adhoc ... #endif ```