text:
Q: Failure to start Zeppelin When I start zeppelin o It starts on port 8080, it says port already in use. I tried changing port in zeppelin in config files, in zeppelin-site.xml.template made it too in zeppelin-env.sh.template adding the env line for the same port.
When I start zeppelin, I get OK, but if I see the open ports, It doesn't appear 8050 anywhere, so looks like It is still trying to deploy on port 8080
This is error I get when I click zeppelin.cmd
/zeppelin/interpreter/ignite/zeppelin-ignite_2.11-0.7.3.jar!/interpreter-settin
g.json
DEBUG [2018-05-06 07:33:49,111] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/jdbc/zeppelin-jdbc-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:49,126] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/kylin/zeppelin-kylin-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:49,281] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/lens/zeppelin-lens-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:49,431] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/livy/zeppelin-livy-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:49,466] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/md/zeppelin-markdown-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:49,754] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/pig/zeppelin-pig-0.7.3.jar!/interpreter-setting.json
 WARN [2018-05-06 07:33:49,794] ({main} Interpreter.java[register]:406) - Static
 initialization is deprecated for interpreter sql, You should change it to use i
nterpreter-setting.json in your jar or interpreter/{interpreter}/interpreter-set
ting.json
 INFO [2018-05-06 07:33:49,794] ({main} InterpreterSettingManager.java[init]:305
) - Interpreter psql.sql found. class=org.apache.zeppelin.postgresql.PostgreSqlI
nterpreter
DEBUG [2018-05-06 07:33:52,889] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/python/zeppelin-python-0.7.3.jar!/interpreter-setting.jso
n
DEBUG [2018-05-06 07:33:53,234] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/sh/zeppelin-shell-0.7.3.jar!/interpreter-setting.json
DEBUG [2018-05-06 07:33:55,279] ({main} InterpreterSettingManager.java[registerI
nterpreterFromResource]:382) - Reading interpreter-setting.json from jar:file:/C
:/zeppelin/interpreter/spark/zeppelin-spark_2.11-0.7.3.jar!/interpreter-setting.
json
DEBUG [2018-05-06 07:33:55,284] ({main} InterpreterSettingManager.java[init]:320
) - Registered: psql.sql -> org.apache.zeppelin.postgresql.PostgreSqlInterpreter
. Properties: {postgresql.password={envName=null, propertyName=null, defaultValu
e=, description=The PostgreSQL user password}, postgresql.max.result={envName=nu
ll, propertyName=null, defaultValue=1000, description=Max number of SQL result t
o display.}, postgresql.user={envName=null, propertyName=null, defaultValue=gpad
min, description=The PostgreSQL user name}, postgresql.url={envName=null, proper
tyName=null, defaultValue=jdbc:postgresql://localhost:5432/, description=The URL
 for PostgreSQL.}, postgresql.driver.name={envName=null, propertyName=null, defa
ultValue=org.postgresql.Driver, description=    JDBC Driver Name}}
 INFO [2018-05-06 07:33:55,289] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name ignite
 INFO [2018-05-06 07:33:55,289] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name python
 INFO [2018-05-06 07:33:55,294] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name jdbc
 INFO [2018-05-06 07:33:55,294] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name psql
 INFO [2018-05-06 07:33:55,294] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name lens
 INFO [2018-05-06 07:33:55,294] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name pig
 INFO [2018-05-06 07:33:55,299] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name flink
 INFO [2018-05-06 07:33:55,299] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name angular
 INFO [2018-05-06 07:33:55,299] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name livy
 INFO [2018-05-06 07:33:55,304] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name file
 INFO [2018-05-06 07:33:55,304] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name elasticsearch
 INFO [2018-05-06 07:33:55,304] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name cassandra
 INFO [2018-05-06 07:33:55,304] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name sh
 INFO [2018-05-06 07:33:55,309] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name spark
 INFO [2018-05-06 07:33:55,309] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name md
 INFO [2018-05-06 07:33:55,309] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name alluxio
 INFO [2018-05-06 07:33:55,309] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name bigquery
 INFO [2018-05-06 07:33:55,314] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name hbase
 INFO [2018-05-06 07:33:55,314] ({main} InterpreterSettingManager.java[init]:337
) - InterpreterSettingRef name kylin
 INFO [2018-05-06 07:33:55,450] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group md : id=2DEPH6PYC, name=md
 INFO [2018-05-06 07:33:55,453] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group psql : id=2DD7ZJKPA, name=psql
 INFO [2018-05-06 07:33:55,457] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group python : id=2DCAMH4GY, name=python
 INFO [2018-05-06 07:33:55,463] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group file : id=2DDZH8WCB, name=file
 INFO [2018-05-06 07:33:55,472] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group elasticsearch : id=2DE3BGT7H, name=elasticsearch
 INFO [2018-05-06 07:33:55,476] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group bigquery : id=2DEVZXKAG, name=bigquery
 INFO [2018-05-06 07:33:55,480] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group hbase : id=2DC4M79BE, name=hbase
 INFO [2018-05-06 07:33:55,482] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group sh : id=2DD1MA4VU, name=sh
 INFO [2018-05-06 07:33:55,482] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group pig : id=2DCNP1WD2, name=pig
 INFO [2018-05-06 07:33:55,482] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group alluxio : id=2DC7G4QW3, name=alluxio
 INFO [2018-05-06 07:33:55,482] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group livy : id=2DEQ54GYT, name=livy
 INFO [2018-05-06 07:33:55,487] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group flink : id=2DDWBXQYG, name=flink
 INFO [2018-05-06 07:33:55,487] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group spark : id=2DF55VV2T, name=spark
 INFO [2018-05-06 07:33:55,487] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group ignite : id=2DCJEAGTV, name=ignite
 INFO [2018-05-06 07:33:55,492] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group kylin : id=2DC5T3GZV, name=kylin
 INFO [2018-05-06 07:33:55,492] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group angular : id=2DFHJM4RD, name=angular
 INFO [2018-05-06 07:33:55,492] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group lens : id=2DC9V3E9V, name=lens
 INFO [2018-05-06 07:33:55,492] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group jdbc : id=2DEECFK3N, name=jdbc
 INFO [2018-05-06 07:33:55,497] ({main} InterpreterSettingManager.java[init]:366
) - InterpreterSetting group cassandra : id=2DCH1RQVX, name=cassandra
 INFO [2018-05-06 07:33:55,537] ({main} InterpreterFactory.java[<init>]:130) - s
hiroEnabled: false
 INFO [2018-05-06 07:33:55,858] ({main} VfsLog.java[info]:138) - Using "C:\Users
\Weltinfo\AppData\Local\Temp\vfs_cache" as temporary files store.
 INFO [2018-05-06 07:33:56,055] ({main} GitNotebookRepo.java[<init>]:63) - Openi
ng a git repo at '/zeppelin/notebook'
 INFO [2018-05-06 07:33:56,578] ({main} NotebookAuthorization.java[loadFromFile]
:96) - C:\zeppelin\conf\notebook-authorization.json
 INFO [2018-05-06 07:33:56,581] ({main} Credentials.java[loadFromFile]:102) - C:
\zeppelin\conf\credentials.json
 INFO [2018-05-06 07:33:56,710] ({main} StdSchedulerFactory.java[instantiate]:11
84) - Using default implementation for ThreadExecutor
 INFO [2018-05-06 07:33:56,720] ({main} SimpleThreadPool.java[initialize]:268) -
 Job execution threads will use class loader of thread: main
 INFO [2018-05-06 07:33:56,775] ({main} SchedulerSignalerImpl.java[<init>]:61) -
 Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignale
rImpl
 INFO [2018-05-06 07:33:56,798] ({main} QuartzScheduler.java[<init>]:240) - Quar
tz Scheduler v.2.2.1 created.
 INFO [2018-05-06 07:33:56,802] ({main} RAMJobStore.java[initialize]:155) - RAMJ
obStore initialized.
 INFO [2018-05-06 07:33:56,806] ({main} QuartzScheduler.java[initialize]:305) -
Scheduler meta-data: Quartz Scheduler (v2.2.1) 'DefaultQuartzScheduler' with ins
tanceId 'NON_CLUSTERED'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persis
tence. and is not clustered.

 INFO [2018-05-06 07:33:56,810] ({main} StdSchedulerFactory.java[instantiate]:13
39) - Quartz scheduler 'DefaultQuartzScheduler' initialized from default resourc
e file in Quartz package: 'quartz.properties'
 INFO [2018-05-06 07:33:56,813] ({main} StdSchedulerFactory.java[instantiate]:13
43) - Quartz scheduler version: 2.2.1
 INFO [2018-05-06 07:33:56,815] ({main} QuartzScheduler.java[start]:575) - Sched
uler DefaultQuartzScheduler_$_NON_CLUSTERED started.
 INFO [2018-05-06 07:33:57,388] ({main} FolderView.java[createFolder]:107) - Cre
ate folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,394] ({main} FolderView.java[createFolder]:107) - Cre
ate folder /
 INFO [2018-05-06 07:33:57,396] ({main} Folder.java[setParent]:168) - Set parent
 of / to /
 INFO [2018-05-06 07:33:57,397] ({main} Folder.java[setParent]:168) - Set parent
 of Zeppelin Tutorial to /
 INFO [2018-05-06 07:33:57,398] ({main} Folder.java[addNote]:184) - Add note 2A9
4M5J1Z to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,456] ({main} Folder.java[addNote]:184) - Add note 2BW
JFTXKJ to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,504] ({main} Folder.java[addNote]:184) - Add note 2BY
EZ5EVK to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,528] ({main} Folder.java[addNote]:184) - Add note 2C2
AUG798 to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,557] ({main} Folder.java[addNote]:184) - Add note 2C3
5YU814 to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,574] ({main} Folder.java[addNote]:184) - Add note 2C5
7UKYWR to folder Zeppelin Tutorial
 INFO [2018-05-06 07:33:57,575] ({main} Notebook.java[<init>]:127) - Notebook in
dexing started...
 INFO [2018-05-06 07:33:58,305] ({main} LuceneSearch.java[addIndexDocs]:305) - I
ndexing 6 notebooks took 729ms
 INFO [2018-05-06 07:33:58,305] ({main} Notebook.java[<init>]:129) - Notebook in
dexing finished: 6 indexed in 0s
 INFO [2018-05-06 07:33:58,603] ({main} ServerImpl.java[initDestination]:94) - S
etting the server's publish address to be /
mai 06, 2018 7:33:58 AM com.sun.jersey.api.core.PackagesResourceConfig init
INFOS: Scanning for root resource and provider classes in the packages:
  org.apache.zeppelin.rest
mai 06, 2018 7:33:58 AM com.sun.jersey.api.core.ScanningResourceConfig logClasse
s
INFOS: Root resource classes found:
  class org.apache.zeppelin.rest.SecurityRestApi
  class org.apache.zeppelin.rest.HeliumRestApi
  class org.apache.zeppelin.rest.ConfigurationsRestApi
  class org.apache.zeppelin.rest.LoginRestApi
  class org.apache.zeppelin.rest.InterpreterRestApi
  class org.apache.zeppelin.rest.NotebookRepoRestApi
  class org.apache.zeppelin.rest.CredentialRestApi
  class org.apache.zeppelin.rest.NotebookRestApi
  class org.apache.zeppelin.rest.ZeppelinRestApi
mai 06, 2018 7:33:58 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFOS: No provider classes found.
mai 06, 2018 7:33:59 AM com.sun.jersey.server.impl.application.WebApplicationImp
l _initiate
INFOS: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM'

mai 06, 2018 7:34:00 AM com.sun.jersey.spi.inject.Errors processErrorMessages
AVERTISSEMENT: The following warnings have been detected with resource and/or pr
ovider classes:
  WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.zeppel
in.rest.CredentialRestApi.getCredentials(java.lang.String) throws java.io.IOExce
ption,java.lang.IllegalArgumentException, should not consume any entity.
  WARNING: A HTTP GET method, public javax.ws.rs.core.Response org.apache.zeppel
in.rest.InterpreterRestApi.listInterpreter(java.lang.String), should not consume
 any entity.
  WARNING: A sub-resource method, public javax.ws.rs.core.Response org.apache.ze
ppelin.rest.NotebookRestApi.createNote(java.lang.String) throws java.io.IOExcept
ion, with URI template, "/", is treated as a resource method
  WARNING: A sub-resource method, public javax.ws.rs.core.Response org.apache.ze
ppelin.rest.NotebookRestApi.getNoteList() throws java.io.IOException, with URI t
emplate, "/", is treated as a resource method
 INFO [2018-05-06 07:34:00,216] ({main} ContextHandler.java[doStart]:744) - Star
ted o.e.j.w.WebAppContext@140e5a13{/,file:/C:/zeppelin/webapps/webapp/,AVAILABLE
}{C:\zeppelin\zeppelin-web-0.7.3.war}
 WARN [2018-05-06 07:34:00,227] ({main} AbstractLifeCycle.java[setFailed]:212) -
 FAILED ServerConnector@1317b708{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException
: Address already in use: bind
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:32
1)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNet
workConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java
:236)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:366)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.apache.zeppelin.server.ZeppelinServer.main(ZeppelinServer.java:18
9)
 WARN [2018-05-06 07:34:00,233] ({main} AbstractLifeCycle.java[setFailed]:212) -
 FAILED org.eclipse.jetty.server.Server@44a6a68e: java.net.BindException: Addres
s already in use: bind
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:32
1)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNet
workConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java
:236)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:366)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.apache.zeppelin.server.ZeppelinServer.main(ZeppelinServer.java:18
9)
ERROR [2018-05-06 07:34:00,236] ({main} ZeppelinServer.java[main]:194) - Error w
hile running jettyServer
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:32
1)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNet
workConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java
:236)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:366)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:68)
        at org.apache.zeppelin.server.ZeppelinServer.main(ZeppelinServer.java:18
9)

A: "zeppelin-site.xml.template" and "zeppelin-env.sh.template" are not the files that are actual used when running Zeppelin. They are - as their name suggest - templates that should help to build the actual configuration files. They should not be changed.
Instead, create a copy of these files that are named "zeppelin-site.xml" or "zeppelin-env.sh" respectively and adopt these files according to your needs. During the next restart of Zeppelin the new settings should be picked up.


text:
Q: Cant get the show on click function on jQuery to work I cant get my jQuery to work.
I want the text "Show more" when the div is closed, then "Show less" when it is open.
This text works when it opens, but when it closes it wont change..
    $('.more_content').click(function(){
        $('p.show').text($('p.show').is(':visible') ? 'Show less' : 'Show more');
        $('#extra_content').slideToggle('fast')
    });

A: The statement
$('p.show').is(':visible')

should be:
$('#extra_content').is(':visible')

A: $('.more_content').click(function(){
$('#extra_content').is(':visible') ? $('p.show').text('Läs mer om oss') : $('p.show').text('Läs mindre om oss') ;
$('#extra_content').slideToggle('fast')
enter code here});

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can I dump the current nconf configuration to an object? Is there any method in nconf to collect all the keys from all the stores into a single object?
Imagine I've got this little script:
assert = require('assert');
nconf = require('nconf');

nconf.argv().env().defaults({'C': 3});
assert.equal(nconf.get('A'), 1);
assert.equal(nconf.get('B'), 2);
assert.equal(nconf.get('C'), 3);
assert.deepEqual({'A':1, 'B':2, 'C':3}, nconf.X); // <-- What's X?

that I run with
A=1 node script.js -B 2

Is there an nconf.X that will pass the test?  I'd even settle for listing all the configured keys.

A: Yes to get the object you can do the following;
nconf.get();

it will fail the test as argv will with the exec string and env will have a lot more variables though.
You could whitelist the env call using the following
nconf.env({whitelist: 'A'});

Also the defaults adds a 'type' with value 'literal' to the resulting output.
For a test that passes you could use this;
var assert = require('assert'),
nconf = require('nconf');

nconf.argv().env({whitelist: ['A']}).defaults({'C': 3});
assert.equal(nconf.get('A'), 1);
assert.equal(nconf.get('B'), 2);
assert.equal(nconf.get('C'), 3);

var object = nconf.get();

delete object.type;
delete object['$0'];
delete object['_'];

assert.deepEqual({'A':1, 'B':2, 'C':3}, object);


text:
Q: Timezone shift and losing milliseconds when inserting dates into Oracle using the R odbc package I'm switching over from using the ROracle package to using the odbc package to connect to Oracle.  Using ROracle, I was able to insert datetimes with milliseconds into a table that had a field with the timestamp data type.  Using the odbc package, milliseconds are lost.  Additionally, when I query back the date I just inserted, the time shifts four hours forward (I'm in Eastern so presumably it's shifting to UTC time).  I've confirmed the time is being inserted correctly into Oracle.  Is there an option that can be set so that milliseconds are retained and is there a way to prevent the time from shifting?
library(odbc)

options(digits.secs = 6)

Sys.setenv(TZ = "EST5EDT",
           ORA_SDTZ = "EST5EDT")

conn <- DBI::dbConnect(odbc::odbc(),
                       driver = "Oracle12c",
                       uid = rstudioapi::showPrompt(title = "username", message = "username", default = ""),
                       pwd = rstudioapi::askForPassword(),
                       dbq = "dbname",
                       timezone = Sys.timezone())

DBI::dbExecute(conn, "create table test_table (datetime timestamp(6))")

df <- data.frame(DATETIME = Sys.time(), stringsAsFactors = FALSE)

# the time has milliseconds in R
print(df)

# insert data
res <- dbSendStatement(conn, "insert into test_table (datetime) values (:1)")
dbBind(res, df)
dbGetRowsAffected(res)
dbClearResult(res)

# the time does not have milliseconds when read back from Oracle and is shifted four hours forward
dbGetQuery(conn, "select * from test_table")

A: Pass the timestamp value as a string and convert it in the SQL:
insert into test_table (datetime) values (TO_TIMESTAMP(:1, 'DD-MON-YYYY HH24:MI:SS.FF'))

Pass your parameter as a string which matches the format in the TO_TIMESTAMP function, e.g.
"22-MAR-2019 17:46:57.123456"

and change the date format to whatever you're comfortable with.
Best of luck


text:
Q: Test Redirect with Capybara and Javascript I'm trying to use capybara with rspec to test my rails app.  I've simplified one problem to this:
I click a link and it redirects me via javascript
window.location="/sports"

I click this link on capybara and look for the page to have content "Sports", but it always fails.
When I open the file in the test server and press the "Submit Payment" method, I am brought to my sports page.  When I watch the selenium tests run, I can see no redirect is going on.
Here are the files:
swipes_spec.rb:
require 'spec_helper'
describe "Swipes" do
  describe "can view index page" do

    it "has checkout in h2" do
      visit swipe_index_path
      page.should have_selector("h2", text: "Checkout")
    end
    it "should have link test js" do
      visit swipe_index_path
      page.should have_link("test js")
    end
    it "responds to js", js: true do
      visit swipe_index_path
      click_link "test js"
      page.should have_selector('a', text: "js works")
    end
    it "responds to button press", js: true do
      visit swipe_index_path
      click_button "Submit Payment"
      wait_until(10) do
        page.has_content?("Select a Sport")
      end
      page.should have_selector('h2', text: "Select")
    end
  end
end

swipe/index.html.erb:

Checkout

<form action="" method="POST" id="payment-form">

        Card Number
        <input type="text" size="20" autocomplete="off" id ="card-number" class="card-number"/>

        CVC
        <input type="text" size="4" autocomplete="off" class="card-cvc"/>

        Expiration (MM/YYYY)
        <input type="text" size="2" class="card-expiry-month"/>
         /
        <input type="text" size="4" class="card-expiry-year"/>

    <button type="submit" class="submit-button">Submit Payment</button>
</form>

<%= link_to_function "test js", '$(this).html("js works")' %>

A: I had some kind of bug.  I ran gem update to update some other gems and this started working.  I also downloaded QT.  One of those things made everything happy.


text:
Q: qooxdoo : How to popup a Window that covers whole screen? How to popup a Window that covers whole screen ?
I have the following code:
Application.js
this.__panel = new myApp.MyPanel();
this.__panel.open();

MyPanel.js
qx.Class.define("myApp.MyPanel",
{
  extend : qx.ui.window.Window,

    construct : function()
    {
      this.base(arguments, "My Panel");
      // adjust size
      this.setWidth(800);
      this.setHeight(480);
    }
});

Instead of 800 x 480, I would like the Window to be open in full screen, without Title and close button. How can I achieve this ?

A: You can use the maximize method to set the window to full screen. But that will still show the caption bar containing the buttons. Depending on what you want, you can hide / disable each of the buttons. If you don't want the caption bar at all, I would simply add the content of the window to the root of you app.

A: To cover the whole screen, use the following lines:
this.setWidth(qx.bom.Viewport.getWidth());
this.setHeight(qx.bom.Viewport.getHeight());

Don't forget to handle browser resizing !
Also, to hide the title bar, add this line:
this.getChildControl("captionbar").setVisibility("excluded");


text:
Q: removing header and indexes when iterating the groups in pandas Need to remove header for each group while iterating.
I have requirement to group by few column and dataframe value for that group
import pandas as pd
df=pd.read_excel('D:\\Python-pandas-numpy-mat_learn\\panda-learn\\test.xlsx')
#column in dataframes are: ['col1','col2','col3','col4']
grp=df.groupby(by=['col1','col2'])
for each in grp.groups:
    print(df[(df['col1']==each[0]) & (df['col2']==each[1])])
#Output is:
   col1  col2  col3   col4
9    32   321    12  5mlds
   col1  col2  col3  col4
0   123    34    44  Row1
1   123    34    66  Row2
   col1  col2  col3 col4
6   214   321  3255  ere
#Want output like
   col1  col2  col3   col4
    32   321    12  5mlds
   123    34    44  Row1
   123    34    66  Row2
   214   321  3255  ere

I don't want headers (['col1','col2','col3','col4']) and indexes for each group

A: Assuming you really need to use a loop, one option:
grp=df.groupby(by=['col1','col2'])

for i, (each, g) in enumerate( grp):
    print(g.to_string(index=False).split('\n', maxsplit=min(i,1))[-1])

Output:
col1  col2  col3  col4
   32   321    12 5mlds
  123    34    44 Row1
  123    34    66 Row2
  214   321  3255  ere


text:
Q: Resizing content to fit height CSS overflowing? I feel like going nuts, if height: 100%; stretches an element to fit its parent height why does it overflow? i'm testing in several browsers and all of them show the same problems.
i have this structure
html
>body
>>container
>>>header
>>>content
>>>footer

what i want is to stretch content height so container fits into browser window
i tried a ton of different approaches, making html and body height 100%, going for absolute and top and bottom of zero... and nothing really works, whenever i stretch content the footer jumps out of the container
here's an example:
<!DOCTYPE html>

1

2

3

what is wrong with this, why is it going out?

A: Maybe this solves your problem.  the inside divs needs to add up to 100%
body{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#container
{
    height: 100%;
}
#header{
    height: 20%;  /*random number  but all three should add up to 100%*/
}
#content
{
    min-height: 70%; /*random number*/
}

#footer{
    height:10%; /*random number*/
}


text:
Q: JPA MetaDataException for different datasources I have the problem with JPA Criteria API while using in my project different datasource persistance.
There are two PU uses different datasources:
<persistence-unit name="analysis" transaction-type="RESOURCE_LOCAL">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <non-jta-data-source>AnalysisDS</non-jta-data-source>
    <class>entity1</class>
    <class>entity2</class>
    <class>entity3</class>

and
<persistence-unit name="reaction" transaction-type="RESOURCE_LOCAL">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <non-jta-data-source>ReactionDS</non-jta-data-source>
    <class>someEntity1</class>
    <class>someEntity2</class>
    <class>someEntity3</class>

Spring load it, in applicationContext
<bean id="defaultAnalysysDataSource"
      class="org.springframework.jndi.JndiObjectFactoryBean"
      lazy-init="default">
    <property name="jndiName" value="AnalysisDS"/>
    <property name="lookupOnStartup" value="false"/>
    <property name="cache" value="true"/>
    <property name="proxyInterface" value="javax.sql.DataSource"/>
</bean>

<bean id="defaultReactionDataSource"
      class="org.springframework.jndi.JndiObjectFactoryBean"
      lazy-init="default">
     <property name="jndiName" value="ReactionDS"/>
     <property name="lookupOnStartup" value="false"/>
     <property name="cache" value="true"/>
     <property name="proxyInterface" value="javax.sql.DataSource"/>
</bean>

In my DAO I can work with this PU with EntityManager, for example for
ReactionDS I'Am using
 @PersistenceContext(unitName = "reaction")
 private EntityManager entityManager;

And all work done -  simple query's and JPQL expressions.
But when I want to introduce to my DAO JPA Criteria API
Like this :
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
...

I have exception after getCriteriaBuilder() method works:
Caused by: <openjpa-2.4.0-r422266:1674604 fatal user error> org.apache.openjpa.util.MetaDataException: Errors encountered while resolving metadata.  See nested exceptions for details.
    at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:675)
    at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:418)
    at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:389)
    at org.apache.openjpa.persistence.meta.MetamodelImpl.(MetamodelImpl.java:86)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(EntityManagerFactoryImpl.java:348)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:332)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

...
Caused by: <openjpa-2.4.0-r422266:1674604 fatal user error> org.apache.openjpa.util.MetaDataException: Table "ANALYSIS.ENTITY1" given for "entity1" does not exist.
    at org.apache.openjpa.jdbc.meta.MappingInfo.createTable(MappingInfo.java:532)
    at org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable(ClassMappingInfo.java:317)
    at org.apache.openjpa.jdbc.meta.ClassMappingInfo.getTable(ClassMappingInfo.java:339)
    at org.apache.openjpa.jdbc.meta.strats.FullClassStrategy.map(FullClassStrategy.java:73)
    at org.apache.openjpa.jdbc.meta.ClassMapping.setStrategy(ClassMapping.java:392)
    at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:55)
    at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:410)
    at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:769)
    at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:658)
    ... 147 more

The problem root cause in JPA, because his trying to use a tables from Analys  in Reaction PU and extracts all meta-classes for entities that are located in different datasources, but access to them is doing in one.
But when I granted select on Entity1 to ReactionDS  - all works done. (because I can use Select * from Analysis.Entity1 from reaction)
The question - how to make the metamodel classes to choose working only within the specified DS in EntityManager (in current example - Reaction, not together with Analysis) ?
p.s Database is Oracle, using Weblogic 12.1.3 and OpenJpa2.4.
Metamodel is generated automatically with maven plugin on compile:
<plugin>
    <groupId>org.bsc.maven</groupId>
    <artifactId>maven-processor-plugin</artifactId>
    <executions>
        <execution>
            <id>process</id>
            <goals>
                <goal>process</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
                <processors>
                    <processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
                </processors>
                <optionMap>
                    <openjpa.metamodel>true</openjpa.metamodel>
                </optionMap>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.apache.openjpa</groupId>
            <artifactId>openjpa</artifactId>
            <version>${openjpa.version}</version>
        </dependency>
    </dependencies>
</plugin>

A: I think you may be confused by your Spring Framework datasource declarations.
These beans do not define your datasource, they only provide a way for other Spring components to access the datasources that have been configured in your server. JPA does not use these at all.
Therefore, your problem lies in the datasources that you have defined in your WebLogic server. It looks like you have defined both datasources to reference the same database instance.


text:
Q: drupal hook functions and their arguments I'm reading through Pro Drupal development right now, and an example on page 82 uses the following function:
function menufun_menu_link_alter(&$item, $menu){
  if ($item['link_path'] == 'logout'){
    $item['link_title'] = 'Sign off';
  }
}

I understand that I can find out what parameters "hook_menu_link_alter" takes by looking at api.drupal.org. What I don't understand is how I'm supposed to find out what $item actually contains. In this example, $item['link_path'] and $item['link_title'] were both used - how did he know they existed?
I'm not only interested in this specific example, of course. I want to be able to do this for any function that I look at in drupal.
Thanks in advance for the help!

A: If you went to api.drupal.org and looked up hook_menu_link_alter, you'd get this page:
http://api.drupal.org/api/function/hook_menu_link_alter/6
Which includes the following note:
"$item Associative array defining a menu link as passed into menu_link_save()."
If you follow the link to the menu_link_save page, you'd be here:
http://api.drupal.org/api/function/menu_link_save/6
In which the contents of the $item parameter is clearly listed under Parameters.

A: If you're using the Devel module I like to throw a
dsm($item)

in there to see what $item currently contains.  It prints a nice interactive array/object navigator.
Granted you still have to go to the API to look up all the possibilities, since this only shows what's currently set.  But it usually contains enough to get what I'm looking for.

A: Using the API docs or displaying variables is both good tools to get info. They both have their merits, using devel is mostly useful when you are debugging and want to  see what is happening. A big part of being a good drupal developer is not knowing everything, but more being able to track down the relevant info. Sometimes it can also bevery useful to look at the code or code by others. Seeing how others do things can sometimes help out a lot when you want to do something similar. Google can also be a good tool or discussing an issue with some one. There are many posibilities, you just have to learn how to use these tools and use what works for you. After spending more time at api.drupal.org you do get better to extract infomation.


text:
Q: Android Java google maps TileOverLay "OSM " @Override
public void onMapReady(GoogleMap map) {
   map.setMapType(GoogleMap.MAP_TYPE_NONE);
   TileProvider tileProvider = new UrlTileProvider(256, 256) {
        @Override
        public synchronized URL getTileUrl(int x, int y, int zoom) {
        String s = String.format("https://tile.openstreetmap.org/%d/%d/%d.jpg", zoom, x, y);
           URL url = null;
            try {
                url = new URL(s);
            } catch (MalformedURLException e) {
                throw new AssertionError(e);
            }
            return url;
        }
    };
   map.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider));
}

Why does the Open StreetMap Tile do not show up in my Maps? Is Google preventing it? https://tile.openstreetmap.org/%d/%d/%d.png

A: You have to use user-agent to use osm map tile servers.
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36";

@Override
    public void onMapReady(GoogleMap map) {
       map.setMapType(GoogleMap.MAP_TYPE_NONE);
       TileProvider tileProvider = new UrlTileProvider(256, 256) {
            @Override
            public synchronized URL getTileUrl(int x, int y, int zoom) {
            String s = String.format("https://tile.openstreetmap.org/%d/%d/%d.jpg", zoom, x, y);

            System.setProperty("http.agent", USER_AGENT);

               URL url = null;
                try {
                    url = new URL(s);
                } catch (MalformedURLException e) {
                    throw new AssertionError(e);
                }
                return url;
            }
        };
       map.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider));
    }


text:
Q: Android - Fragment with gridView collapse when soft keyboard I have an Activity with a ViewPager with two Fragments:
My problem
When I open soft keyboard on FragmentA with Edittext, the fragment it's collapsed, but only when I uncomment the GridViewon FragmentB.
I tried all options on AndroidManifest.xml using: android:windowSoftInputMode=
  <activity
      //.......
      android:windowSoftInputMode="stateHidden|adjustPan" />

I tried to put it programmatically on fragments and Activity:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

And it doesn't work, always Activity/Fragments it's collapsed...
If I comment or remove the GridView on the XML, Works fine
Then... the problem? It's the GridView, but I need that...
FragmentB code with GridView
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="16dp"
    android:background="#64aca89c">

    <GridView
        android:id="@+id/gridView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:drawSelectorOnTop="true"
        android:numColumns="3"
        android:stretchMode="columnWidth"
        android:verticalSpacing="10dp"
        android:focusable="true"
        android:clickable="true"
        android:horizontalSpacing="5dp"
        android:gravity="center" />

</FrameLayout>

Any suggestions?


text:
Q: Connecting 32-bit R to a 32-bit Access database I am using 32-bit R with RStudio to try and connect to an .accdb file.  I have 32-bit MS Access running on my machine.
R version:
platform       i386-w64-mingw32
arch           i386
os             mingw32
system         i386, mingw32
status
major          3
minor          1.2
...
language       R
version.string R version 3.1.2 (2014-10-31)
nickname       Pumpkin Helmet

I'm trying to use the RODBC package to connect to an MS Access database. I cannot use odbcConnectAccess("location_of_database.accdb") to connect to a database provided by a client.  This particular database was created with Access 2013.  When I try to connect, I get a variety of warning messages:
Warning messages:
1: In odbcDriverConnect(con, ...) :
  [RODBC] ERROR: state HY000, code -1028, message [Microsoft][ODBC Microsoft     Access Driver] Cannot open database '(unknown)'.  It may not be a database that     your application recognizes, or the file may be corrupt.
2: closing unused RODBC handle 12
3: In odbcDriverConnect(con, ...) :
  [RODBC] ERROR: state 01000, code 1, message [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x11a4 Thread 0x798 DBC 0x88e0064 Jet'.
4: In odbcDriverConnect(con, ...) :
  [RODBC] ERROR: state 01000, code 1, message [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x11a4 Thread 0x798 DBC 0x88e0064 Jet'.
5: In odbcDriverConnect(con, ...) : ODBC connection failed

Interestingly, I can use odbcConnectAccess2007() to connect successfully to databases that were created with Access 2010; however, when I try to use odbcConnectAccess() to connect to those same databases, I get the same errors above.
A Google search of the Error: state 01000, code 1 message above suggests that this page may be helpful, but even after following the steps to alter the HKEY_LOCAL_MACHINE does not work.
While I originally thought that this question was promising, the warning message there relates to "ACE DSN" while the error messages I'm seeing relate to "Jet DSN."
I cannot open the databases I'm trying to access with RODBC with my version of Access as the databases were created with Access 2013 and I have Access 2010 installed.
Can anyone help me trouble shoot why I can't open this database with odbcConnectAccess()?

A:
why I can't open this [Access 2013] database with odbcConnectAccess()?

I'm fairly certain that
odbcConnectAccess(<fileSpec>)

is simply shorthand for
odbcDriverConnect('DRIVER={Microsoft Access Driver (*.mdb)};DBQ=<fileSpec>')

(i.e., the older "Jet" ODBC driver), and
odbcConnectAccess2007(<fileSpec>)

is simply shorthand for
odbcDriverConnect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=<fileSpec>')

(i.e., the newer "ACE" ODBC driver).
The older "Jet" driver cannot work with .accdb files, so odbcConnectAccess2007() would be required. If that throws an "Unrecognized database format" error then it's likely that the database file is damaged.


text:
Q: CollapsingToolbarLayout wrong title display I have the following code, and I don't know why after collapse the toolbar the title is not showed properly. Check the text "T. My tanatory".
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="256dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            android:fitsSystemWindows="true"
            app:contentScrim="?android:attr/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp">

            <ImageView
                android:id="@+id/iv_tanatorio"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/t_tanatory"
                android:scaleType="centerCrop"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="parallax"/>

            <android.support.v7.widget.Toolbar
                android:id="@+id/myToolbar"
                android:layout_width="match_parent"
                android:layout_height="?android:attr/actionBarSize"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                app:navigationIcon="@drawable/ic_arrow_back_white_24dp"
                app:layout_collapseMode="pin"/>

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_tanatosalas"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</android.support.design.widget.CoordinatorLayout>

A: You forgot to set your toolbar in your activity onCreate
setSupportActionBar(findViewById<Toolbar>(R.id.myToolbar))//Kotlin

setSupportActionBar(findViewById(R.id.myToolbar) //java

A: can you please check using layout_scrollFlags in your toolbar and  adjust expandedTitleMarginEnd and start in collapsing toolbar layout, also remove android:fitsSystemWindows="true" from imageview
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:fitsSystemWindows="true"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="#039BE5"
        app:expandedTitleMarginEnd="180dp"
        app:expandedTitleMarginStart="100dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/cover_pic"
                android:layout_width="match_parent"
                android:layout_height="110dp"
                android:minHeight="100dp"
                android:scaleType="centerCrop"
                android:src="@drawable/meetup_details"
                app:layout_collapseMode="parallax">

            </ImageView>

        </RelativeLayout>

        <android.support.v7.widget.Toolbar
            android:id="@+id/mytoolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

        </android.support.v7.widget.Toolbar>

    </android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>


text:
Q: Yesterday-access.log is pointing to a different directory Under /var/log/ispconfig/httpd/quotednews.com/ folder, the yesterday-access.log is pointing to a wrong directory. yesterday-access.log is just a symlink to: /var/www/clients/client1/web2/log/20130626-access.log.
The correct value should be:
yesterday-access.log -> /var/www/clients/client1/web3/log/20130626-access.log

It should be web3 and not web2.
The same thing happen also under /var/www/clients/client1/web3/log/ folder. The yesterday-access.log is pointing to /var/www/clients/client1/web2/log/20130626-access.log.
The correct value should be:
yesterday-access.log -> /var/www/clients/client1/web3/log/20130626-access.log

That's why the log file of web2 folder is affected. That is, it was overwritten by web3 user and awstats cannot create the correct stats for mydomain.com.
Web2 is using a different site.
The example of this are:
mydomain.com = /var/www/clients/client1/web2
example.com = /var/www/clients/client1/web3

But I'm wondering why example.com is using the mydomain.com's log file.
Anyone know how to change this?

A: Could you remove the soft link
yesterday-access.log -> var/www/clients/client1/web2/log/20130626-access.log
under /var/www/clients/client1/web3/log/


text:
Q: Can mount SMB share using nautilus but not using smbclient I can mount my SMB share using nautilus by simply adding the location smb://ip
Here's what happens when I use smbclient on another computer:
lz@air:/media$ smbclient -L //192.168.0.3
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\lz's password:
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

    Sharename       Type      Comment
    ---------       ----      -------
    Public          Disk
    IPC$            IPC       IPC Service (Samba 4.5.12-Debian)
Connection to 192.168.0.3 failed (Error NT_STATUS_CONNECTION_REFUSED)
NetBIOS over TCP disabled -- no workgroup available

Here's locally, to localhost:
pi@raspberrypi:~ $ smbclient -L localhost
WARNING: The "syslog" option is deprecated
Enter pi's password:
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

    Sharename       Type      Comment
    ---------       ----      -------
    Public          Disk
    IPC$            IPC       IPC Service (Samba 4.5.12-Debian)
Connection to localhost failed (Error NT_STATUS_CONNECTION_DISCONNECTED)
NetBIOS over TCP disabled -- no workgroup available

Here's my SAMBA configuration:
RUN echo '[global]\n\
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536\n\
smb ports = 445\n\
max protocol = SMB2\n\
min receivefile size = 16384\n\
deadtime = 30\n\
os level = 20\n\
map to guest = bad user\n\
printer = bsd\n\
printcap name = /dev/null\n\
load printers = no\n\
create mask = 0644\n\
force create mode = 0644\n\
directory mask = 0755\n\
force directory mode = 0755\n\
browsable = yes\n\
writable = yes\n\
guest account = root\n\
force user = root\n\
force group = root\n\
[Public]\n\
path = /data/share\n\
guest ok = yes\n\
read only = no' > /etc/samba/smb.conf

It's worth mentioning that there's no password on my samba
UPDATE:
After doing what told in the comment below, I have
lz@air:~$ smbclient -L //192.168.0.3
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\lz's password:
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

    Sharename       Type      Comment
    ---------       ----      -------
    Public          Disk
    IPC$            IPC       IPC Service (Samba 4.5.12-Debian)
OS=[Windows 6.1] Server=[Samba 4.5.12-Debian]

    Server               Comment
    ---------            -------

    Workgroup            Master
    ---------            -------
    WORKGROUP

SHouldn't I see my folders? How should I mount this?

A: [1] Edit /etc/samba/smb.conf
[2] Place a # sign in front of smb ports = 445 so that it looks like this:
#smb ports = 445
This will make it to samba does not read that line and it will default to using ports 445 and 139.
[3] Restart the smbd service:
sudo service smbd restart

SHouldn't I see my folders?

smbclient -L only lists the shares available on the server - and you have one named Public

How should I mount this?

smbclient //192.168.0.3/Public

You will end up at a command prompt: smb: \>
Enter  ls to get a listing of the contents of Public and quit to close the connection.


text:
Q: How to know if the current page takes up all the content to jump to a new page with ItextSharp in C # Currently I have a I create a pdf with itextsharp:
    using (MemoryStream stream = new System.IO.MemoryStream())
        {
            //Document pdfDoc = new Document(PageSize.A4, 25, 25, 65, 15);
            float myWidth = 227f;
            float myHeight = 842f;

            var pgSize = new Rectangle(myWidth, myHeight);
            using (var pdfDoc = new Document(pgSize, 2, 2, 1, 30))
            {
                var pdfWriter = PdfWriter.GetInstance(pdfDoc, stream);
                //pdfWriter.PageEvent = new ITextEvents();
                pdfDoc.Open();
                //code

I need to know that if the whole page was written, do a line break, to add a footer at the end, without overwriting the last one. How could I do it?


text:
Q: null Extras when calling for ACTION_PICK I call the gallery with an intent like this :
        Intent picturePickerIntent = new Intent(Intent.ACTION_PICK,
            MediaStore.Images.Media.INTERNAL_CONTENT_URI);
    picturePickerIntent.setType("image/*");
    picturePickerIntent.putExtra("crop", "true");
    picturePickerIntent.putExtra("aspectX", 1);
    picturePickerIntent.putExtra("aspectY", 1);
    picturePickerIntent.putExtra("outputX", PHOTO_SIZE);
    picturePickerIntent.putExtra("outputY", PHOTO_SIZE);
    picturePickerIntent.putExtra("return-data", true);

    startActivityForResult(picturePickerIntent, IMAGE_GALERY_REQUEST);

And then I get the result:
if (resultCode == RESULT_OK) {
        if (requestCode == IMAGE_GALERY_REQUEST) {
            Bundle extras = data.getExtras();
            if (extras != null) {
                bm = extras.getParcelable("data");
                photoView.setImageBitmap(bm);
                if (avatarSelected != null) {
                    avatarSelected.setBackgroundColor(Color.TRANSPARENT);
                }
                this.avatarSelected = null;
            }else{
                // Sometimes, the photo isn't loaded
                Toast.makeText(this, "The photo has not been loaded", Toast.LENGTH_SHORT).show();
            }

On certain devices, this code works like a charm, on others it shows the toast every time, and on a 6.0 emulator it works literally once out of two.
What did I do wrong ?

A: The code seems to have no problem but you did forget about dynamic permissions which will always return null.Read this here.
if (ContextCompat.checkSelfPermission(thisActivity,
                Manifest.permission.READ_CONTACTS)
        != PackageManager.PERMISSION_GRANTED) {

    if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
            Manifest.permission.READ_CONTACTS)) {

    } else {

        ActivityCompat.requestPermissions(thisActivity,
                new String[]{Manifest.permission.READ_CONTACTS},
                MY_PERMISSIONS_REQUEST_READ_CONTACTS);

    }
}

Basically you need to ask for permissions dynamically for android 6 and plus .


text:
Q: Problemas con GET Y module export hola buenas me encuentro haciendo un get con axios
axios({
            method: 'GET',
            url: `https://api.hubapi.com/contacts/v1/contact/vid/${id}/profile?hapikey=${ hapikey }`,
            responseType: 'json',

        }).then(respuesta => {
            console.log("contactos encontrados")
            console.log(respuesta.data);
            res.status(200).send(respuesta.data)

        })
        .catch((error) =>{
            console.log("Error al encontrar los contactos")
            console.log(error);
            res.status(500).send(error)
        })

    }

me han entregado 50.000 id, los cuales deben ir en el apartado ${ id }. Por lo tanto hice un module export de la siguiente manera
module.exports = {
    id: [ '1', '2', '3'....]
   }

llame a la variable desde mi app.js
var id = require('../../config/id').id;

al dar send en postman me lanza un error ya que literal me esta escribiendo las 50mil variables en ${ id }.
"https://api.hubapi.com/contacts/v1/contact/vid/1,2,3,4....."

Hay alguna forma de ir llamando a la api un id a la vez con algún código? tipo loop o algo? soy muy nuevo en esto y me encuentro estancado.

A: Correcto, sería usando un loop, y dentro de ese loop, realizar el get, pero no con el id, sino con el contador del loop:
for (let index = 0, index < id.length; index++) {
axios({
        method: 'GET',
        url: `https://api.hubapi.com/contacts/v1/contact/vid/${index}/profile?hapikey=${ hapikey }`,
            responseType: 'json',
        }).then(respuesta => {
            console.log("contactos encontrados")
            console.log(respuesta.data);
            res.status(200).send(respuesta.data)

        })
        .catch((error) =>{
            console.log("Error al encontrar los contactos")
            console.log(error);
            res.status(500).send(error)
        })

    }
}

Ahora, el detalle con esto es que hara la peticion una vez por cada id, por lo que si lo que quieres es ir agregando cada usuario encontrado, podrías crear un array, y cada usuario ir agregandolo a ese array:
const usersFounded = []
for (let index = 0, index < id.length; index++) {
axios({
        method: 'GET',
        url: `https://api.hubapi.com/contacts/v1/contact/vid/${index}/profile?hapikey=${ hapikey }`,
            responseType: 'json',
        }).then(respuesta => {
usersFounded.push(respuesta.data)
        })
        .catch((error) =>{
            console.log("Error al encontrar los contactos")
            console.log(error);
            res.status(500).send(error)
        })
    }
}
console.log("contactos encontrados")
console.log(usersFounded);
res.status(200).send(usersFounded)


text:
Q: check if user adds new image the form I need to create else action. If user don't upload new image, in database should stay the old image. The code that adds image is:
<?php
require_once 'database.php';
require_once 'functions.php';
$content_pic = false;
$id = $_POST['id'];
$title = trim($_POST['title']);
$text = trim($_POST['text']);

if (!empty($_FILES["content_pic"])) {
        if ($_FILES["content_pic"]["error"] == UPLOAD_ERR_OK) {
            $uploads_dir = __DIR__ . '/files';
            $tmp_name = $_FILES["content_pic"]["tmp_name"];
            $name = $_FILES["content_pic"]["name"];
            if (move_uploaded_file($tmp_name, "{$uploads_dir}/{$name}")) {
                $content_pic = "files/{$name}";
            }
        }
    }else{
    }

$db = database_connect();
$stmt = $db->prepare($select_query);
$stmt->execute(array($id));
$result = $stmt->fetch(PDO::FETCH_ASSOC);

$stmt = $db->prepare("UPDATE content SET title = ?, text= ?, content_pic = ? WHERE id = ? ");

header("Location: item_view.php?id=" . $id);
exit();

I don't know how create else action

A: You could try along these lines - where the variable $content_pic is set as false by default so if no image is uploaded a differnt sql statement can be executed.
<?php

    if( isset( $_POST['id'], $_POST['title'], $_POST['text'] ) ){

        require_once 'database.php';
        require_once 'functions.php';

        $id     =   $_POST['id'];
        $title  =   trim( $_POST['title'] );
        $text   =   trim( $_POST['text'] );
        $field  =   'content_pic';

        /* will be populated if new upload detected */
        $content_pic = false;

        if( !empty( $_FILES[ $field ] ) ) {

            $file=$_FILES[ $field ];

            if( $file["error"] == UPLOAD_ERR_OK ) {

                $uploads_dir    = __DIR__ . '/files';
                $tmp_name       = $file['tmp_name'];
                $name           = $file['name'];
                $savepath       = $uploads_dir . DIRECTORY_SEPARATOR . $name;

                if( move_uploaded_file( $tmp_name, $savepath ) ) {
                    $content_pic = realpath( $savepath ) ? "files/{$name}" : false;
                }
            }
        }

        switch( $content_pic ){
            case false:
                $sql='update `content` set `title`=? `text`=? where `id`=?';
                $params=array( $title, $text, $id );
            break;
            default:
                $sql='update `content` set `title`=? `text`=?, `content_pic`=? where `id`=?';
                $params=array( $title, $text, $content_pic, $id );
            break;
        }

        $db = database_connect();
        $stmt = $db->prepare( $sql );
        $stmt->execute( $params );
        $db->close();
    }

?>


text:
Q: Как сделать, чтобы не оставалось пустое место в ячейках таблицы? Как сделать, чтобы не оставалось пустое место в ячейках?
Вот код

         Информация
        Адрес
        Площадь
        Комнат
        Цена

Добавлено


text:
Q: Конверсия с csv в xml Здравствуйте. Реализовал конвертацию следующим образом:
using System.Xml.Linq;

  XElement xmlf = new XElement("Folder",
      new XElement("name", "NASI PARTNERZY HANDLOWI"),
      from str in source
      let fields = str.Split(';')
      select
      new XElement("Placemark", new XElement("name", fields[0]),
          new XElement("description", fields[1]),
          new XElement("styleUrl", fields[2]),
          new XElement("ExtendedData",
              new XElement("Data",
                  new XAttribute("name", "opis"),
                  new XElement("value", fields[3])),
              new XElement("Data", new XAttribute("name", "Informacje:"),
                  new XElement("value", fields[4])),
              new XElement("Data",
                  new XAttribute("name", "Telefon:"),
                  new XElement("value", fields[5])),
              new XElement("Data",
                  new XAttribute("name", "E-mail"),
                  new XElement("value", fields[6])),
              new XElement("Data",
                  new XAttribute("name", "Strona:"),
                  new XElement("value", fields[7])),
              new XElement("Data",
                  new XAttribute("name", "gx_media_links"),
                  new XElement("value", fields[8]))),
          new XElement("Point", new XElement("coordinates", fields[9]))));

В конце получаю правильную структуру, но заполненую неправильными данными. Пример структуры:
    <Folder>
        <name>Company</name>
        <Placemark>
        <name>Company name</name>
        <description>Some description</description>

        <ExtendedData>
            <Data name='opis'>
                <value>Som desc.</value>
            </Data>
            <Data name='Informacje:'>
                <value>Some information </value>
            </Data>
            <Data name='Telefon:'>
                <value>(22) 333 55 55 (22)</value>
            </Data>
            <Data name='E-mail'>
                <value>qwerty@mail.com</value>
            </Data>
            <Data name='Strona:'>
                <value>www.google.com</value>
            </Data>
            <Data name='gx_media_links'>
                <value>some links</value>
            </Data>
        </ExtendedData>
        <Point>
            <coordinates>22.912227,52.12221,0.0</coordinates>
        </Point>
    </Placemark>
</Folder>

Причина неправильного заполнения в черезмерной насыщенности текста элементом ; , есть ли возможность, на основании текущего кода, реализовать правильную конвертацию? Или какие варианты реализации целесообразно использовать в данной ситуации.
Обновление
Приведу полную версию кода для уточнение правильности чтения CSV с помощью CSVHelpera (имею проблему с выводом в XML, выводится только одна линия из CSV файла):
                    using (var sr = new StreamReader(Fd2.FileName))
            {
                var reader = new CsvReader(sr);

                IEnumerable<DataRecord> records = reader.GetRecords<DataRecord>();

                foreach (DataRecord record in records) // (int element in fibarray) (var record in DataRecord)
                {
                    XElement category = new XElement("Folder", new XElement("name", "NASI PARTNERZY HANDLOWI"), new XElement("Placemark", new XElement("name", record.name), new XElement("description", record.opis + "

Informacje: " + record.information + "
Telefon: " + record.telefon + "
E-mail: " + record.mail + "
Strona: " + record.strona + "
" + record.img), new XElement("styleUrl", record.icon), new XElement("ExtendedData",  new XElement("Data", new XAttribute("name", "gx_media_links"), new XElement("value", record.gx))), new XElement("Point", new XElement("coordinates", record.cordinates))));

                    using (var sw2 = new StreamWriter(xmlFile, false, Encoding.UTF8))
                        sw2.WriteLine(category);

                }
            }

A: Пожалуйста, прекратите обрабатывать CSV файлы "руками"!
CSV не так прост как кажется. Из самых частых проблем:

*

*наличие сепаратора внутри значений ячеек ("some;data")

*наличие переноса строк внутри значений ячеек (причем переносы разных форматов -- Windows, Unix, Mac)

*наличие двойных кавычек внутри экранированных значений ячеек ("some""data")

Поэтому этом даже при наличии правильно сформированного файла тривиальное решение -- разбить его на строки, а каждую строку разбить string.Split()'ом -- не является корректным.
Используйте готовую библиотеку, авторы которой позаботились о закавыках формата. Например, CsvHelper. Как крайний вариант (если вдруг не устроит производительность готовых библиотек или у вас какой-то кастомный CSV), можно написать свой парсер, который обработает самые распространенные проблемы (пример черновика парсера с использованием конечного автомата).

A: Если значения полей не будут начинаться с ";" - то можно так:
let fields = str.Split(new[] { "\";" }, StringSplitOptions.None)
  .Select(x => x.Trim().Substring(1))


text:
Q: adding script tag in angular 2 im using angular4 to implement my administration panel of my site. for ui, im using a template that i downloaded from the internet for free. this template have a datatable feature that shows data in a very nice way and gives me ability to search, sort and pagination.
im loading this table in an angular component called organization-list.component that is :
    import { Component, AfterViewChecked } from "@angular/core";
    import { Script } from "../../shared/services/scriptLoader.service";

    @Component({
      selector: "organization-list",
      templateUrl: "./organization-list.component.html"
    })
    export class OrganizationListComponent implements AfterViewChecked {
      constructor(private script: Script) {

      }

      ngAfterViewChecked() {
        this.script.loadScript("assets/datatables/jquery.dataTables.min.js");
        this.script.loadScript("assets/datatables/dataTables.bootstrap.js");
      }
    }

for loading features of this form there are two scripts: jquery.dataTables.min.js and jquery.dataTables.min.js that i want theme to loaded just in this component(page). so i used this function to load them:
import { Injectable } from '@angular/core';

declare var document: any;

@Injectable()
export class Script {

  loadScript(path: string) {
    //load script
    return new Promise((resolve, reject) => {
      let script = document.createElement('script');
      script.type = 'text/javascript';
      script.src = path;
      if (script.readyState) {  //IE
        script.onreadystatechange = () => {
          if (script.readyState === "loaded" || script.readyState === "complete") {
            script.onreadystatechange = null;
            resolve({ loaded: true, status: 'Loaded' });
          }
        };
      } else {  //Others
        script.onload = () => {
          resolve({ loaded: true, status: 'Loaded' });
        };
      };
      script.onerror = (error: any) => resolve({ loaded: false, status: 'Loaded' });
      document.getElementsByTagName('head')[0].appendChild(script);
    });
  }
}

and this works good. in scripts i mentioned the is a function called datatable that must be called in the end of html page like this:
<script>
  $(document).ready(function() {
    $('#datatable').dataTable();
  });
</script>

the problem is that i want to call this peace of code every time this page loads (i use angular routing so page dosnt load entirely). what is the solution ?
thanks.

A: You are loading the scripts in an unspecified order and you are not caching them which is bad for performance and makes their behavior unpredictable.
Leave it to your loader or bundler. If you are using SystemJS or Webpack 3*, then simply
import 'assets/datatables/jquery.dataTables.min.js';
import 'assets/datatables/dataTables.bootstrap.js';

Use a view child to access the element that the datatable is applied to.
import {Component, ViewChild} from '@angular/core';
import $ from 'jquery';
import 'assets/datatables/jquery.dataTables.min.js';
import 'assets/datatables/dataTables.bootstrap.js';

@Component({
  template: '<div #datatable></div>'
}) export default class {
  @ViewChild('datatable') datatable: Element;

  ngAfterViewInit() {
    $(this.datatable).datatable();
  }

}

Get rid of the script tag containing the $('#datatable').datatable() completely.
Note that at the time of this writing, the Angular CLI is based on Webpack.


text:
Q: Set theory like first-order theory of ordered pairs The widely-accepted Kuratowski definition of an ordered pair is $(a,b):=\{\{a\},\{a,b\}\}$. This definition makes perfect sense in the context of first-order set theory. However, how would a first-order theory using ordered pairs as basic notion look like?
My first try used the alphabet $S_{pair}=\{l,r\}$, where $l$ and $r$ are unary function symbols.

*

*Axioms of atoms The left and right part of an atom $x$ are the same as $x$ itself. A pair is an atom if it is the same as its left or right part:
$$\forall x(l(x) \equiv x \Leftrightarrow r(x) \equiv x)$$
Let $Ax$ be an abbreviation for $(l(x) \equiv x \lor r(x) \equiv x)$, i.e. $Ax$ if and only if $x$ is an atom.

*Axiom of extensionality Two pairs $x$ and $y$ are equal (or $x$ or $y$ is an atom) if their left and right parts are the same:
$$\forall x \forall y ((l(x) \equiv l(y) \land r(x) \equiv r(y)) \Rightarrow (x \equiv y \lor Ax \lor Ay))$$

*Axiom of pairing For two pairs $x$ and $y$, there exists a pair $z$ (which is not an atom) with $x$ and $y$ as left and right part:
$$\forall x \forall y \exists z(\lnot Az \land l(z) \equiv x \land r(z) \equiv y)$$

*Axiom schema of induction For each formula $\phi(x,y_1,...,y_k)$ in the language of pairs, the first-order induction axiom holds, i.e. $\phi(x,\bar{y})$ with $\bar{y}=y_1,...,y_k$ is true for all pairs $x$, if it is true for all atoms $x$, and true if it is true for the left and right part of $x$:
$$\forall \bar{y}((\forall x (Ax \Rightarrow \phi(x,\bar{y})) \land$$ $$\forall x((\phi(l(x),\bar{y})\land \phi(r(x),\bar{y})) \Rightarrow \phi(x,\bar{y})))$$
$$\Rightarrow \forall x \phi(x,\bar{y}))$$

I could add another axiom to ensure that there exists exactly one atom (which would then be the empty pair), but this wouldn't change the resulting theory significantly. I wonder more whether the axiom schema of induction as given above will achieve what I intent. (Note While trying to prove this, I discovered that the axioms were "buggy", which I tried to fix by introducing the abbreviation $Ax$ and using it appropriately.)
Question Will the  first-order theory of pairs given above have the same "consistency strength" as PA, if we additionally ensure that there is only a given fixed finite number of atoms by an additional axiom? Will the resulting theory be equivalent to PA in a certain way?

An alternative idea for an axiomatic first-order theory of pair would be to take ordered pairs of sets as basic objects (s-pairs for short), and define pairs and sets in terms of these s-pairs. I could use the alphabet $S_{s-pair}=\{\in,\ni\}$ where $\in$ and $\ni$ would be binary relation symbols. I could define that an s-pair $p$ is a pair if its left and right part contain no more than one element ($\forall x \forall y(((x \in p \land y \in p) \lor (p \ni x \land p \ni y)) \Rightarrow x \equiv y)$). The most symmetric definition for a set seems to be to define that an s-pair $s$ is a set if its left and right part contain the same elements ($\forall x(x\in s \Leftrightarrow s \ni x)$).
However, now the question arises how to best "convert" the ZF axioms of set theory into similar axioms for s-pairs. Perhaps it would already be sufficient to only modify the axiom of extensionality, leave all the other axioms to refer only to $\in$, and only add one axiom allowing to regroup left and right parts, like
$$\forall l \forall r \exists p(\forall x(x \in p \Leftrightarrow l \ni x)\land\forall y(p \ni y \Leftrightarrow y \in r))$$
Question The thing with the s-pairs described above seems closely related to surreal numbers and Conway games. Is there some place where such a first-order theory is described in sufficient detail? Does the above construction works more or less and gives a theory with the same "consistency strength" as ZF, or are there significant differences to ZF that I overlooked (i.e. which prevent such a theory from having similar properties as ZF)?

A: The theory is not very expressive, it only allows ordered pairs, which is not too much to work with (compared to set theory which allows sets of an unlimited size).
To add well-foundedness, one can suggest using the following schema:

For every $n\in\omega$ we write the following axiom: $$\forall x_1\dots\forall x_n\Bigg(\bigwedge_{i=1}^{n-1}\Big(l(x_i)\equiv x_{i+1}\lor r(x_i)\equiv x_{i+1}\Big)\rightarrow\exists z\Big(\bigvee_{i=1}^n\big(z\equiv x_i\big)\land\bigwedge_{i=1}^n\big(l(z)\equiv x_i\lor r(z)\equiv x_i\rightarrow z\equiv x_i\big)\Big)\Bigg)$$

This schema says that whenever we have a decreasing sequence, there is an element which is an atom (this is comparable to the axiom of foundation which implies [and is probably equivalent to] "the transitive closure of every set contains the empty set").
One caveat is that I don't know how this schema is going to work in the context of non-standard integers, but let us assume for starters that the model is nice and fine and dandy. All the integers are standard etc.


text:
Q: con el segundo click si se me activa el select Tengo el siguiente código, pero solo me funciona cuando le doy dos el segundo click para activar el checkbox
    function uncheck() {

        var checkbox1 = document.getElementById("sNombre_centro");
        var checkbox2 = document.getElementById("sNombre_formacion");

    checkbox1.onclick = function() {
        $("#nombre_centro option:first").attr("selected", "selected");
        var isChecked = document.getElementById("sNombre_centro").checked;
        document.getElementById("nombre_centro").disabled = !isChecked;
        if (checkbox1.checked == true) {
           $("#nombre_formacion option:first").attr("selected", "selected");
            checkbox2.checked = null;
        }
        var isChecked = document.getElementById("sNombre_formacion").checked;
        document.getElementById("nombre_formacion").disabled = !isChecked;

    }

    checkbox2.onclick = function() {
        $("#nombre_formacion option:first").attr("selected", "selected");
        var isChecked = document.getElementById("sNombre_formacion").checked;
        document.getElementById("nombre_formacion").disabled = !isChecked;
        if (checkbox2.checked == true) {
            $("#nombre_centro option:first").attr("selected", "selected");
            checkbox1.checked = null;
        }
        var isChecked = document.getElementById("sNombre_centro").checked;
        document.getElementById("nombre_centro").disabled = !isChecked;

    }
}

echo '<input type="checkbox" name="sNombre_centro" id="sNombre_centro"   onClick="uncheck()"/>';
echo "Centros: ";
echo '<select class="input"   name="nombre_centro" id="nombre_centro" disabled>';
echo '<input type="checkbox" name="sNombre_formacion" id="sNombre_formacion"   onClick="uncheck()"/>';
echo "Formaciones: ";
echo '<select  class="input"   name="nombre_formacion" id="nombre_formacion" disabled>';

el problema que tengo es que solo se activa cuando le doy el segundo click de activacion al checkbox, y lo quer quiero lograr es que se active el select asociado al checkbox al primer click

A: Ejecútala al final y te funcionará desde el primer click.

function uncheck() {

    var checkbox1 = document.getElementById("sNombre_centro");
    var checkbox2 = document.getElementById("sNombre_formacion");

    checkbox1.onclick = function() {
        $("#nombre_centro option:first").attr("selected", "selected");
        var isChecked = document.getElementById("sNombre_centro").checked;
        document.getElementById("nombre_centro").disabled = !isChecked;
        if (checkbox1.checked == true) {
           $("#nombre_formacion option:first").attr("selected", "selected");
            checkbox2.checked = null;
        }
        var isChecked = document.getElementById("sNombre_formacion").checked;
        document.getElementById("nombre_formacion").disabled = !isChecked;

    }

    checkbox2.onclick = function() {
        $("#nombre_formacion option:first").attr("selected", "selected");
        var isChecked = document.getElementById("sNombre_formacion").checked;
        document.getElementById("nombre_formacion").disabled = !isChecked;
        if (checkbox2.checked == true) {
            $("#nombre_centro option:first").attr("selected", "selected");
            checkbox1.checked = null;
        }
        var isChecked = document.getElementById("sNombre_centro").checked;
        document.getElementById("nombre_centro").disabled = !isChecked;

    }
}

uncheck();
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="checkbox" name="sNombre_centro" id="sNombre_centro"   onClick="uncheck()"/>'
Centros: "
<select class="input"   name="nombre_centro" id="nombre_centro" disabled>
<input type="checkbox" name="sNombre_formacion" id="sNombre_formacion"   onClick="uncheck()"/>
Formaciones:
<select  class="input"   name="nombre_formacion" id="nombre_formacion" disabled>

A: ¿Por qué uncheck() es una función?
Deberías cargar todo lo que tienes en uncheck() desde el principio, no en el onclick de cada checkbox.


text:
Q: Enigmail Public Key Reference I seem to remember in earlier versions of EnigMail, the Thunderbird add-on that it was possible to have it display the location of your public key (name & server). This doesn't seem to be the case any more. This was a useful; feature for me as I tend to use a single public key for several accounts, but would like to indicate the key being used to sign the message. It seems to me that it would be a good practice to advertise where your public key is available as there are many key servers.

*

*Does anyone know how to activate this functionality again (other than a sig) ?

*Is it a bad security practice to advertise where your key is?

(My current versions are Thunderbird 3.1.6 and EnigMail 1.1.2).

A: Found it: If you look at the individual settings for each account, under "OpenPGP Security", if you select the "Use PGP/MIME by default" option, in the advanced settings you can specify that you want to send your keyID, and also which server to look for it on.


text:
Q: Expect Script - For Loop - How to use more than 1 variable How can I use more than 1 variable in expect script "for loop"? Please help.
Thanks in advance.
With one variable:
for {set i 1} {$i < 256} {incr i 1} {

}

How can 2 or 3 variables, say init , condition, increment of i, j, k ?
comma, semicolon is not working.
Thanks,
Krishna

A: Keep in mind that expect is an extension of Tcl. Documentation of Tcl is available.
The syntax of for is:

for start test next body

"start" and "next" are both evaluated as scripts. "test" is an expression
You can do:
for {set i 1; set j 10; set k "x"} {$i < 5 && $j > 0} {incr i; incr j -2; append k x} {
    puts "$i\t$j\t$k"
}

outputs
1   10  x
2   8   xx
3   6   xxx
4   4   xxxx

This is equivalent to the following, so use whatever is most readable.
set i 1
set j 10
set k "x"

while {$i < 5 && $j > 0} {
    puts "$i\t$j\t$k"

    incr i
    incr j -2
    append k x
}

In fact, you can make liberal use of newlines in a for command too
for {
    set i 1
    set j 10
    set k "x"
} {
    $i < 5 && $j > 0
} {
    incr i
    incr j -2
    append k x
} {
    puts "$i\t$j\t$k"
}


text:
Q: custome error page for HTTP 414 request uri is too long I am able to set custom error pages for application level errors with help of customErrors as well as HTTP errors with httpErrors. But none of it handles HTTP 414 error.
I have gone through the answer on this article but I am not sure whether I haven't researched enough to handle custom error page for this.

A: Since the 414 URI Too Long (RFC 7231 6.5.12) is an error caused by a malformed /path?query part of an URI in the very first line of an HTTP request, the server never sees any other headers including Host: header of the second line: it already responds right after it gets the too long URI, e.g.
-->   GET /imagine/this/was/a/.../too.long?request=url HTTP/1.1
<--   HTTP/1.1 414 Request-URI Too Long
<--   Content-Type: text/html; charset=us-ascii
<--   Server: Microsoft-HTTPAPI/2.0

Therefore, it's natural that you cannot configure custom 414 pages per site on any web server.
I thought this would be possible server-wide on IIS using global IIS > Error Pages, but based on a test it seems that the 414 error is fixed and cannot be modified at all. The only source article I could find was from Microsoft's retired KB content, Error Message: HTTP 414 - Request - URI Too Long:

IIS checks the string length of the URI and does not service a request
when the URI is longer than expected. This is by design.

However, this condition should be rare as you could easily prevent it from happening by:

*

*using POST instead of GET whenever there could be longer query data than 2000 characters.

*be careful that any redirection won't cause a loop where the URL itself gets used as a prefix.

With these principles a user would never see the page, and the human readable custom error pages are merely for users: any software can use the error code from the very first response header line.


text:
Q: How do i Permanently disable fn key lock when laptop reboots When laptop reboots, the Fn key is automatically on.
How can I disable the Fn key when rebooting ?

A: Maybe you can look in the BIOS of your computer.
At startup, spam the Del key or F11 or maybe another depending on the model (look at the manual) and maybe you will find an Fn key option somewhere, it's hard to answer without knowing the model.
A link that can help you is TomsHardware.com.


text:
Q: How to increase listview performance? I have a scenario where i have to do following task:
1. populate a list-view.
2. perform database operation which is very time consuming task.
3. database processing/operation time is sometime unpredictable.
I have used listView using holder pattern, now it is working faster than earlier but still taking significant time. What else i can do to improve the performance.
I have an idea but i am afraid whether it will be good to implement or not. Idea is to put the database operation in AsyncTask and update my listview there only.
But i am afraid of doing so is because my listview is totally dependent on database result. So i can display something on Listview only when i am done with DB operation
Please suggest is using Async task will be good approach and please suggest any other idea.

A: Using the Holder approach is good. Use that in your adapters always. Make sure you are reusing the convert views as well.
Using an AsyncTask is the best option. But you don't have to wait for the entire operation to complete. Read up on how AsyncTask works. Use the publishProgress() method in your doInBackground() of the AsyncTask to give batches of data to your list.
For example, if you have to process 100 rows, process 10, then do a publishProgress() which will update the list with those 10 rows. When you process the next batch, update the list with publishProgress() again.


text:
Q: Crash on import pyomo.inveron module in interpreter embedded into C++app I am trying to use pyomo package to perform some calculations in complicated C++ app. The C++ module in which embedded Python-interpreter runs is shared library, that used as a plugin by main app. Main app calls plugin using dlopen/dlsym.
Environment:
-Debian 10.3 x86_64;
-Python v.3.7.3 (default);
-GCC v.8.3.0.
The error occurs at the moment of import pyomo.environ subpackage:
#include <Python.h>
...
Py_Initialize();
PyRun_SimpleString("import pyomo.environ");

After execute PyRun_SimpleString("import pyomo.environ"); string i see following output:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 69, in _import_packages
    _do_import(pname)
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 16, in _do_import
    importlib.import_module(pkg_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/dist-packages/pyomo/common/__init__.py", line 27, in <module>
    from ._task import pyomo_api, PyomoAPIData, PyomoAPIFactory
  File "/usr/local/lib/python3.7/dist-packages/pyomo/common/_task.py", line 22, in <module>
    import pyutilib.workflow
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/workflow/__init__.py", line 17, in <module>
    from pyutilib.workflow.executable import ExecutableResource
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/workflow/executable.py", line 5, in <module>
    import pyutilib.services
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/services/__init__.py", line 10, in <module>
    from pyutilib.services.services import registered_executable, register_executable, TempfileManager
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/services/services.py", line 13, in <module>
    from pyutilib.component.config import TempfileManager
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/component/config/__init__.py", line 22, in <module>
    from pyutilib.component.config.logging_config import LoggingConfig
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/component/config/logging_config.py", line 14, in <module>
    import logging.handlers as handlers
  File "/usr/lib/python3.7/logging/handlers.py", line 28, in <module>
    import queue
  File "/usr/lib/python3.7/queue.py", line 16, in <module>
    from _queue import Empty
ImportError: /usr/lib/python3.7/lib-dynload/_queue.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyExc_MemoryError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 97, in <module>
    _import_packages()
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 81, in _import_packages
    raise ImportError(msg)
ImportError: pyomo.environ failed to import pyomo.common.plugins:
Original ImportError: /usr/lib/python3.7/lib-dynload/_queue.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyExc_MemoryError
Traceback:
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 69, in _import_packages
    _do_import(pname)
  File "/usr/local/lib/python3.7/dist-packages/pyomo/environ/__init__.py", line 16, in _do_import
    importlib.import_module(pkg_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/dist-packages/pyomo/common/__init__.py", line 27, in <module>
    from ._task import pyomo_api, PyomoAPIData, PyomoAPIFactory
  File "/usr/local/lib/python3.7/dist-packages/pyomo/common/_task.py", line 22, in <module>
    import pyutilib.workflow
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/workflow/__init__.py", line 17, in <module>
    from pyutilib.workflow.executable import ExecutableResource
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/workflow/executable.py", line 5, in <module>
    import pyutilib.services
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/services/__init__.py", line 10, in <module>
    from pyutilib.services.services import registered_executable, register_executable, TempfileManager
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/services/services.py", line 13, in <module>
    from pyutilib.component.config import TempfileManager
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/component/config/__init__.py", line 22, in <module>
    from pyutilib.component.config.logging_config import LoggingConfig
  File "/usr/local/lib/python3.7/dist-packages/pyutilib/component/config/logging_config.py", line 14, in <module>
    import logging.handlers as handlers
  File "/usr/lib/python3.7/logging/handlers.py", line 28, in <module>
    import queue
  File "/usr/lib/python3.7/queue.py", line 16, in <module>
    from _queue import Empty

Clarification:
This problem appears only if interpreter runs inside dynamically loaded shared library. If I start my python code directly from python or from interpreter, embedded into standalone test app, all works as expected.


text:
Q: AJAX Cursor - Sharepoint Visual Webpart Am creating a custom SharePoint 2010 webpart.
I am new to AJAX so please help me on this.
Can anyone give me a step by step procedure to do the following:
On button Click:

*

*disable the button

*display a wait screen/wait animation / hourglass cursor

*do a long job.

*display in a text box that Job successfully completed.
To make it more easier to understand I am posting my code below:
Following is my VisualWebPart.ascx file:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1.ascx.cs" Inherits="AE_Project_Form.VisualWebPart1.VisualWebPart1" %>

<asp:Button ID="btn_Submit" runat="server" OnClick="btn_Submit_Click" Text="Submit" Width="97px" Height="20px" />

And now my VisualWebPart.ascx.cs file looks like this:
using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
using System.Data;

namespace AE_Project_Form.VisualWebPart1
{
    [ToolboxItemAttribute(false)]
    public partial class VisualWebPart1 : WebPart
{
public VisualWebPart1()
        {
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();

        }
protected void Page_Load(object sender, EventArgs e)
        {
            this.btn_Submit.Attributes.Add("onClick", "ShowMessage()");
}
protected void btn_Submit_Click(object sender, EventArgs e)
        {
//Do a long process including some Database updates etc...

//Just show a MSGBOX saying process completed

Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsStartupScriptRegistered(cstype, "PopupScript"))
{
 String cstext = "alert('Successfully Added  Project');";
cs.RegisterStartupScript(cstype, "PopupScript", cstext, true);
 }

}
}

Now what I want the webpart to do is that when a button is clicked:

*

*disable button and start the waiting cursor

*Do the long database process

*After the long process is complete show a message box that process completed .
But what happens is that the button is not disabled nor I see the waiting cursor. The long processor takes a long time as expected and just displays a final message box.
Am I wrong in my understanding of Javascript C# webpart coding here somewhere?

A: I got the answer in my discussion here :
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentprevious/thread/09f6e65c-5d8c-4516-81f1-f48c21d20ef0/?prof=required
Please see the last reply from Jack ... It worked for me thanks ...