Questions tagged [mode]

Mode is a state in which a program exposes a particular subset of its functionality.

977 questions
7
votes
2 answers

In javavscript, what is the difference between: (function(){"use strict"}) (); and "use strict"?

What is the difference between: (function () {'use strict';})(); and "use strict". I don't understand when or why I would use one over the other? I think that one declares the complete external JS document strict and the other makes a function…
Starkemp315
  • 151
  • 1
  • 1
  • 4
7
votes
3 answers

Detecting Vista IE7 Protected Mode with Javascript

I'd like to be able to detect Vista IE7 Protected Mode within a page using javascript, preferably. My thinking is to perform an action that would violate protected mode, thus exposing it. The goal is to give appropriate site help messaging to IE7…
jdev
  • 729
  • 2
  • 13
  • 36
7
votes
1 answer

Programmatically setting major mode of buffer with emacs lisp

I wish to programmatically set the major mode of a buffer. I have dug into the documentation, and the function set-buffer-major-mode only takes a buffer object. I am essentially looking for a function that takes a buffer object and a mode…
CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216
7
votes
7 answers

Most efficient way to order an array of Strings by frequency

I have an array of Strings: String[] stringArray = {"x", "y", "z", "x", "x", "y", "a"}; What is the quickest/most efficient way to order this into a smaller Collection in order of how frequent each String is with its frequency? I though about using…
Eduardo
  • 6,900
  • 17
  • 77
  • 121
7
votes
1 answer

SELECT mode/modal value SQL

My first table dbo.Port contains aggregated details about each portfolio Portfolio Yield Duration Coupon Port1 0.62 1.10 0.98 Port2 0.52 0.91 2.46 Port3 0.40 0.70 0.37 My second table…
TylerDurden
  • 1,632
  • 1
  • 20
  • 30
7
votes
4 answers

Java popup saying applications contains both unsigned and signed code

I am using Mac 10.7 running Java 1.7.0_21. I am trying to run a Java applet application that is signed and towards the end of the application I get a mixed mode security popup saying "Block potentially unsafe components from being run?". All the…
user1216750
  • 483
  • 3
  • 10
  • 17
7
votes
1 answer

Calculate mode in SQL

I have seen the answer from a previous post, which works fine but I have a small dilemma. Taking the same scenario: A table that list students' grades per class. I want a result set that looks like: BIO...B CHEM...C Where the "B" and "C" are the…
Frida
  • 85
  • 1
  • 2
  • 4
6
votes
3 answers

Emacs mode: how to specify that thing in square brackets should be colored

I write a simple emacs mode. How do I explicitly specify that all things in e.g. square brackets should be colored. Must be smth like that: ( (if thing is in square brackets) . font-lock-string-face)
Adobe
  • 12,967
  • 10
  • 85
  • 126
6
votes
2 answers

Force iPhone web app to landscape mode

How do you force an iPhone web app (not a native app) into landscape mode?
tom barnes
6
votes
2 answers

r summarize_if with multiple conditions

I'm trying to reduce a df of observations to a single observation (single line). I would like to summarize_if is numeric with the mean and if is string or factor with the mode. The code below doesn't work, but I hope it gives the idea. Thanks! #data…
fiodeno
  • 77
  • 8
6
votes
1 answer

Dbeaver table locking

I'm using DBeaver 5.0.5. I created a database connection and setted it to "production" type. When I run an application which does a drop table on this database, I got something like this : Query | 1568 | Waiting for table metadata lock | DROP…
Parison
  • 179
  • 1
  • 2
  • 8
6
votes
3 answers

Get mode (most often) value in Spark column with groupBy

I have a SparkR DataFrame and I want to get the mode (most often) value for each unique name. How can I do this? There doesn't seem to be a built-in mode function. Either a SparkR or PySpark solution will do. # Create DF df <- data.frame(name =…
Gaurav Bansal
  • 5,221
  • 14
  • 45
  • 91
6
votes
1 answer

How to detect if the current major mode is derived from prog-mode

I want to write a function that invokes one of 2 functions, depending on whether the current major mode is a prog-mode. How do I detect if the current major mode is a prog-mode?
windrg00
  • 457
  • 3
  • 9
6
votes
3 answers

Computing the mode (most frequent element) of a set in linear time?

In the book "The Algorithm Design Manual" by Skiena, computing the mode (most frequent element) of a set, is said to have a Ω(n log n) lower bound (this puzzles me), but also (correctly i guess) that no faster worst-case algorithm exists for…
6
votes
1 answer

Addressing issues with Apache Spark application run in Client mode from Docker container

I'm trying to connect to Standalone Apache Spark cluster from a dockerized Apache Spark application using Client mode. Driver gives the Spark Master and the Workers its address. When run inside a docker container it will use…
Ajk
  • 520
  • 1
  • 5
  • 14